-
Notifications
You must be signed in to change notification settings - Fork 8
skipUntil
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>
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.
xs = source
zs = output
xs ──o──o──o──o──o──/
│ │ │
other ──────────o│ │ │
│ │ │
zs ───────────o──o──/
IObservable.<T>
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)
// ...