【发布时间】:2014-10-23 17:41:11
【问题描述】:
我正在尝试从 BaconJS 生成 zip example。但它不起作用。
var obs = Bacon.fromArray([{ x: 1, y: 2 },
{ x: 3, y: 4 }]);
var x = obs.map('.x');
var y = obs.map('.y');
var result = x.zip(y, function(x, y) {
return x + y;
});
// This doesn't work
// if `result` is replaced with `x` then it produces 1, 3 correctly
result.onValue(function(value) {
$("#events").append($("<li>").text(value))
});
【问题讨论】:
标签: javascript node.js reactive-programming rxjs bacon.js