Rx.Observable.prototype.takeUntil(other)
Returns the values from the source observable sequence until the other observable sequence or Promise produces a value.
Arguments
other
(Observable
|Promise
): Observable sequence or Promise that terminates propagation of elements of the source sequence.
Returns
(Observable
): An observable sequence containing the elements of the source sequence up to the point the other sequence or Promise interrupted further propagation.
Example
var source = Rx.Observable.timer(0, 1000)
.takeUntil(Rx.Observable.timer(5000));
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
Location
File:
Dist:
Prerequisites:
- None
NPM Packages:
NuGet Packages:
Unit Tests: