TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

2 点作者 shaohua将近 11 年前

1 comment

shaohua将近 11 年前
Trying to migrate large Backbone apps to React&#x2F;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&#x27;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:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;react&#x2F;blob&#x2F;master&#x2F;examples&#x2F;todom...</a><p>waitFor: function(&#x2F;<i>array</i>&#x2F; promiseIndexes, &#x2F;<i>function</i>&#x2F; callback) {<p><pre><code> var selectedPromises = _promises.filter(function(&#x2F;*object*&#x2F; _, &#x2F;*number*&#x2F; j) { return promiseIndexes.indexOf(j) !== -1; }); Promise.all(selectedPromises).then(callback); }</code></pre>