skipUntil

signature: skipUntil(the: Observable): Observable

Skip emitted values from source until provided observable emits.

Examples

Example 1: Skip until observable emits

( jsBin |
jsFiddle )

  1. import { interval } from 'rxjs/observable/interval';
  2. import { timer } from 'rxjs/observable/timer';
  3. import { skipUntil } from 'rxjs/operators';
  4. //emit every 1s
  5. const source = interval(1000);
  6. //skip emitted values from source until inner observable emits (6s)
  7. const example = source.pipe(skipUntil(timer(6000)));
  8. //output: 5...6...7...8........
  9. const subscribe = example.subscribe(val => console.log(val));

Additional Resources


:file_folder: Source Code:
https://github.com/ReactiveX/rxjs/blob/master/src/internal/operators/skipUntil.ts