Skip to content

Commit

Permalink
Update Dispatcher.js
Browse files Browse the repository at this point in the history
  • Loading branch information
volkanunsal committed May 4, 2014
1 parent a7823a3 commit c81c07c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions examples/todomvc-flux/js/dispatcher/Dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ var _clearPromises = function() {
_promises = [];
};

/**
* Used below in waitFor().
* @param {number} index The index within the _promises array
*/
var _checkPromise = function(_,j){
return _promises.indexOf(j) !== -1;
}

var Dispatcher = function() {};
Dispatcher.prototype = merge(Dispatcher.prototype, {

Expand Down Expand Up @@ -116,7 +108,7 @@ Dispatcher.prototype = merge(Dispatcher.prototype, {
* A more robust Dispatcher would issue a warning in this scenario.
*/
waitFor: function(/*array*/ promiseIndexes, /*function*/ callback) {
var selectedPromises = _promises.filter(_checkPromise)
var selectedPromises = _promises.filter(function(_,j){return promiseIndexes.indexOf(j) !== -1;})
Promise.all(selectedPromises).then(callback);
}

Expand Down

0 comments on commit c81c07c

Please sign in to comment.