2013-04-24 74 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