Skip to content

Is this a reasonable way to implement React/Flux with Backbone?

github.com/shaohua
2 pointsshaohua1 comment
On HN

Comments

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...

https://github.com/facebook/react/blob/master/examples/todom...

waitFor: function(/array/ promiseIndexes, /function/ callback) {

    var selectedPromises = _promises.filter(function(/*object*/ _, /*number*/ j) {
      return promiseIndexes.indexOf(j) !== -1;
    });

    Promise.all(selectedPromises).then(callback);

  }
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.