Skip to content
richardszalay edited this page May 20, 2011 · 9 revisions

Ignores values from a source sequence until a value is received from another sequence

function skipUntil(other : IObservable.<*>) : IObservable.<T>

Remarks

other is also subscribed to. The values in the source sequence are skipped until other emits a value, at which time other is unsubscribed from and all remaining values in the source sequence are emitted.

The returned sequence completes when the source sequence completes.

The returned sequence errors when the source sequence errors or when the other sequence errors.

Marble Diagrams

xs = source
zs = output

xs    ──o──o──o──o──o──/
                 │  │  │
other ──────────o│  │  │
                 │  │  │
zs    ───────────o──o──/

Return Value

IObservable.<T>

Examples

var source : IObservable = Observable.interval(500)
    .skipUntil( Observable.interval(2001) );

source.subscribe(function(value : int) : void
    {
        trace(value);
    });

// Trace output is:
// 4 (at 2500 ms)
// 5 (at 3000 ms)
// 6 (at 3500 ms)
// ...
Clone this wiki locally