Skip to content

Commit

Permalink
Added no-op callbacks to subscriptions with undefined callbacks.
Browse files Browse the repository at this point in the history
Fixes Issue postaljs#3:
"You can only make functions into Conduits."
postaljs#3
  • Loading branch information
joashc committed Oct 24, 2014
1 parent 3aa5752 commit 2c89eb3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/when.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ var ForkJoin = function ( queue, onSuccess, onError, options ) {
};

_.each( queue, function ( sub ) {
// Add no-op callback for subscriptions with undefined callbacks.
if (!sub.callback) {
sub.callback = function () {};
}
var subscriptionDefinition = postal.subscribe( sub );
subscriptionDefinition.data = undefined;
subscriptionDefinition.subscribe( function ( data ) {
Expand Down

0 comments on commit 2c89eb3

Please sign in to comment.