2013-04-24 36 views
0

我试图找出如果下面是可能与现有的任何运营商在RxJS,或者如果我需要推出自己的分机:如何获得像RxJS订阅模式的承诺?

var x = // some observable sequence 
var y = // some observable sequence 
var z = // some observable sequence 

// 'when' should only call onNext when all of x, y and z has returned at 
// least one value. After that, 'when' should continue to call onNext if 
// any of x, y, z changes their value. 
var w = Rx.Observable.when(x, y, z).select(function(x, y, z) { 
    // do stuff values of from z, y, x. 
}); 

最佳,埃吉尔。

回答

1

貌似我想通了自己:)

combineLatest实例函数不正是我需要的。

+1

您可能也对Join Patterns感兴趣:http://stackoverflow.com/questions/3867858/reactive-extensions-for-net-rx-take-action-once-all-events-are-completed – raimohanska 2013-04-24 20:49:02