every
signature: every(predicate: function, thisArg: any): Observable
every(predicate: function, thisArg: any): ObservableIf all values pass predicate before completion emit true, else false.
Examples
// RxJS v6+
import { every } from 'rxjs/operators';
import { of } from 'rxjs';
//emit 5 values
const source = of(1, 2, 3, 4, 5);
const example = source.pipe(
//is every value even?
every(val => val % 2 === 0)
);
//output: false
const subscribe = example.subscribe(val => console.log(val));Additional Resources
Last updated