我是第一次制作一个相当简单的流星应用程序,它应该查询来自某个仓库的所有git问题.在从github api获取问题列表之后,我们的想法是从这些问题中创建一组任务.但是,每当我尝试查询当前任务列表时,我得到:
.../.meteor/tools/c2a0453c51/lib/node_modules/fibers/future.js:83
W20140418-17:00:43.872(-7)? (STDERR) throw new Error('Can\'t wait without a fiber');
W20140418-17:00:43.872(-7)? (STDERR) ^
W20140418-17:00:43.889(-7)? (STDERR) Error: Can't wait without a fiber
W20140418-17:00:43.889(-7)? (STDERR) at Function.wait
(.../.meteor/tools/c2a0453c51/lib/node_modules/fibers/future.js:83:9)
W20140418-17:00:43.890(-7)? (STDERR) at Object.Future.wait
(.../.meteor/tools/c2a0453c51/lib/node_modules/fibers/future.js:325:10)
W20140418-17:00:43.890(-7)? (STDERR) at _.extend._nextObject (packages/mongo-
livedata/mongo_driver.js:805)
W20140418-17:00:43.890(-7)? (STDERR) at _.extend.forEach (packages/mongo-livedata/mongo_driver.js:836)
W20140418-17:00:43.890(-7)? (STDERR) at Cursor.(anonymous function) [as forEach] (packages/mongo-
livedata/mongo_driver.js:695)
W20140418-17:00:43.890(-7)? (STDERR) at app/server/publish.js:51:33
W20140418-17:00:43.890(-7)? (STDERR) at Array.forEach (native)
W20140418-17:00:43.891(-7)? (STDERR) at app/server/publish.js:49:19
W20140418-17:00:43.891(-7)? (STDERR) at
...packages/npm/.build/npm/node_modules/github/api/v3.0.0/issues.js:116:17
W20140418-17:00:43.891(-7)? (STDERR) at IncomingMessage.<anonymous>
(...packages/npm/.build/npm/node_modules/github/index.js:756:21)
Run Code Online (Sandbox Code Playgroud)
我的第一个想法是,当我应该使用节点光纤时,我正在某处使用回调,但代码似乎相对简单:
var repos = ['my-repo', …
Run Code Online (Sandbox Code Playgroud) 我正在研究一个flux应用程序,我正在考虑采用immutable.js来维护状态.我看到react提供了自己的帮助器来更新不可变对象(http://facebook.github.io/react/docs/update.html),但是无法告诉它与immutable自己的setIn和updateIn方法有什么不同(也就是说,我已经可以将对象与===进行比较,如果它们随setIn变化.是否有理由将react helper与immutable.js一起使用?它只是语法糖吗?
TL; DR是:
var map = Immutable.fromJS({bar: 'baz'});
map2 = React.addons.update(map, {
bar: {$set: 'foo'}
});
Run Code Online (Sandbox Code Playgroud)
不同于
var map = Immutable.fromJS({bar: 'baz'});
map2 = map.set('bar', 'foo');
Run Code Online (Sandbox Code Playgroud)