Skip to content

Commit

Permalink
Address slava's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashko Stubailo committed Apr 2, 2015
1 parent ac93ac5 commit 5d81562
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/blaze/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,15 @@ Blaze.TemplateInstance.prototype.subscribe = function (/* arguments */) {
}
};

var connection;
if(_.has(options, 'connection')) {
connection = options.connection;
delete options.connection;
}
var connection = options.connection;
var callbacks = _.pick(options, ["onReady", "onError", "onStop"]);

args.push(options);
// The callbacks are passed as the last item in the arguments array passed to
// View#subscribe
args.push(callbacks);

// View#subscribe takes the connection as one of the options in the last
// argument
subHandle = self.view.subscribe.call(self.view, args, {
connection: connection
});
Expand Down

0 comments on commit 5d81562

Please sign in to comment.