A series of plans (specified as an Array of as a series of arguments) created by use of the Then operator on patterns.
args
(arguments|Array): A series of plans (specified as an Array of as a series of arguments) created by use of the then operator on patterns.
(Observable
): Observable sequence with the results form matching several patterns.
// Fire each plan when both are ready
var source = Rx.Observable.when(
Rx.Observable.timer(100).and(Rx.Observable.timer(500)).thenDo(function (x, y) { return 'first'; }),
Rx.Observable.timer(400).and(Rx.Observable.timer(300)).thenDo(function (x, y) { return 'second'; })
);
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
// => Next: second
// => Next: first
// => Completed
File:
Dist:
Prerequisites:
rx
.joinpatterns.jsrx.js
|rx.compat.js
|rx.lite.js
|rx.lite.compat.js
NPM Packages:
NuGet Packages:
Unit Tests: