SkipUntil

discard items emitted by an Observable until a second Observable emits an item

The SkipUntil subscribes to the source Observable, but ignores its emissions until such time as a second Observable emits an item, at which point SkipUntil begins to mirror the source Observable.

See Also

Language-Specific Information:

TBD

TBD

skipUntil

In RxGroovy, this operator is implemented as skipUntil.

skipUntil does not by default operate on any particular Scheduler.

skipUntil

In RxJava, this operator is implemented as skipUntil.

skipUntil does not by default operate on any particular Scheduler.

skipUntil

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.

RxPHP implements this operator as skipUntil.

Returns the values from the source observable sequence only after the other observable sequence produces a value.

Sample Code

//from https://github.com/ReactiveX/RxPHP/blob/master/demo/skip/skipUntil.php

$observable = Rx\Observable::interval(1000)
    ->skipUntil(\Rx\Observable::timer(5000))
    ->take(3);

$observable->subscribe($stdoutObserver);

   
Next value: 4
Next value: 5
Next value: 6
Complete!