Extract handler result publish code.

This allows easier extending by packages.
This commit is contained in:
Mitar
2015-09-19 03:37:24 -07:00
committed by Sashko Stubailo
parent 99e8ddaa51
commit 60eaf91624

View File

@@ -1035,6 +1035,10 @@ _.extend(Subscription.prototype, {
if (self._isDeactivated())
return;
self._publishHandlerResult(res);
},
_publishHandlerResult: function (res) {
// SPECIAL CASE: Instead of writing their own callbacks that invoke
// this.added/changed/ready/etc, the user can just return a collection
// cursor or array of cursors from the publish function; we call their
@@ -1051,6 +1055,8 @@ _.extend(Subscription.prototype, {
// reactiveThingy.publishMe();
// });
// };
var self = this;
var isCursor = function (c) {
return c && c._publishCursor;
};