Trying to migrate large Backbone apps to React/Flux. Need help on best practices to implement the Flux architecture. The team is very familiar with Backbone, hence trying to re-use Backbone.Model and Backbone.Events. However, I couldn't see a clear way of implementing store.waitFor() without introducing a promise library...<p><a href="https://github.com/facebook/react/blob/master/examples/todomvc-flux/js/dispatcher/Dispatcher.js" rel="nofollow">https://github.com/facebook/react/blob/master/examples/todom...</a><p>waitFor: function(/<i>array</i>/ promiseIndexes, /<i>function</i>/ callback) {<p><pre><code> var selectedPromises = _promises.filter(function(/*object*/ _, /*number*/ j) {
return promiseIndexes.indexOf(j) !== -1;
});
Promise.all(selectedPromises).then(callback);
}</code></pre>