RxJS also implements a skipUntilWithTime
operator that does not skip a particular quantity
of items from the source Observable, but skips items based on chronology. You set this skip period by
passing in a parameter to skipUntilWithTime
, in either of these formats:
- a number
- skips items from the source Observable until this many milliseconds have passed since the Observable was subscribed to
- a
Date
- skips items from the source Observable until this absolute time
You may also, optionally, pass in a Scheduler as a second parameter, and
the timer will operate on that Scheduler (skipUntilWithTime
uses the timeout
Scheduler by default).
Sample Code
var source = Rx.Observable.timer(0, 1000)
.skipUntilWithTime(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
skipUntilWithTime
is found in each of the following distributions:
rx.all.js
rx.all.compat.js
rx.time.js
(requires rx.js
or rx.compat.js
)
rx.lite.js
rx.lite.compat.js