RxJS implements the skipUntil
operator. You can pass it either an Observable or a
Promise
that it will monitor for an item that triggers skipUntil
to begin
mirroring the source Observable.
Sample Code
var source = Rx.Observable.timer(0, 1000)
.skipUntil(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: 6
Next: 7
Next: 8
Completed
skipUntil
is found in each of the following distributions:
rx.js
rx.all.js
rx.all.compat.js
rx.compat.js
rx.lite.js
rx.lite.compat.js
There is also a skipUntilWithTime
operator to which you can pass an absolute time or an
initial duration in place of an Observable, but this is described on the
Skip operator page.