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

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