diff --git a/packages/ddp-server/livedata_server.js b/packages/ddp-server/livedata_server.js index 4054483237..421f5419e4 100644 --- a/packages/ddp-server/livedata_server.js +++ b/packages/ddp-server/livedata_server.js @@ -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; };