filter
operator omits all values from source that don't match the predicate function
1234567891011121314151617const { rxObserver } = require('api/v0.3'); const { timer } = require('rxjs'); const { filter, take } = require('rxjs/operators'); const source$ = timer(0, 5).pipe( take(4) ); const result$ = source$.pipe( filter(x => x % 2) ); source$.subscribe(rxObserver()); result$.subscribe(rxObserver());