doc/api/core/operators/switch.md
Rx.Observable.prototype.switch()Rx.Observable.prototype.switchLatest() DEPRECATEDTransforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. There is an alias for this method called switchLatest for browsers <IE9.
(Observable): The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
var source = Rx.Observable.range(0, 3)
.select(function (x) { return Rx.Observable.range(x, 3); })
.switch();
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
// => Next: 0
// => Next: 1
// => Next: 2
// => Next: 3
// => Next: 4
// => Completed
File:
Dist:
Prerequisites:
NPM Packages:
NuGet Packages:
Unit Tests: