January 2019
Beginner
210 pages
4h 47m
English
The filter operator function can be used to find the values in an observable that adhere to a given constraint:
import { from } from "rxjs";import { filter } from "rxjs/operators";const observable = from<number>([2, 30, 22, 5, 60, 1]);observable.pipe(filter(x => x > 10));const subscription = observable.subscribe( (value) => console.log(value));subscription.unsubscribe();
The preceding code snippet uses the filter operator to find the values in an observable greater than ten. The following marble diagram showcases the initial sequence and the result sequence after applying the filter operator:

The result sequence contains only some values ...
Read now
Unlock full access