Matches when the observable sequence has an available value and projects the value.
selector
(Function
): Selector that will be invoked for values in the source sequence.
(Plan
): Plan that produces the projected values, to be fed (with other plans) to the when operator.
var selector = function (x, y) { return x + ", " + y; };
var source = Rx.Observable.when(
Rx.Observable.interval(250).and(Rx.Observable.of("A", "B", "C")).thenDo(selector),
Rx.Observable.interval(300).and(Rx.Observable.of("a", "b")).thenDo(selector)
);
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
// => Next: 0, A
// => Next: 0, a
// => Next: 1, B
// => Next: 1, b
// => Next: 2, C
// => Completed
File:
Dist:
Prerequisites:
NPM Packages:
NuGet Packages:
Unit Tests: