skipWhile

연산자(operator) 정의: skipWhile(predicate: Function): Observable

Skip emitted values from source until provided expression is false.

Examples

Example 1: Skip while values below threshold

( jsBin | jsFiddle )

//emit every 1s
const source = Rx.Observable.interval(1000);
//skip emitted values from source while value is less than 5
const example = source.skipWhile(val => val < 5);
//output: 5...6...7...8........
const subscribe = example.subscribe(val => console.log(val));

Additional Resources


:file_folder: Source Code: https://github.com/ReactiveX/rxjs/blob/master/src/operator/skipWhile.ts

results matching ""

    No results matching ""