function stable operator
Flattens an Observable-of-Observables by applying combineLatest when the Observable-of-Observables completes.
combineLatestAll<R>(project?: (...values: any[]) => R) project | (...values: any[]) => R | Optional. Default is optional function to map the most recent values from each inner Observable into a new result. Takes each of the most recent values from each collected inner Observable as arguments, in order. |
combineLatestAll takes an Observable of Observables, and collects all Observables from it. Once the outer Observable completes, it subscribes to all collected Observables and combines their values using the combineLatest strategy, such that:
project function is provided, it is called with each recent value from each inner Observable in whatever order they arrived, and the result of the project function is what is emitted by the output Observable.project function, an array of all the most recent values is emitted by the output Observable.Map two click events to a finite interval Observable, then apply combineLatestAll
import { fromEvent, map, interval, take, combineLatestAll } from 'rxjs';
const clicks = fromEvent(document, 'click');
const higherOrder = clicks.pipe(
map(() => interval(Math.random() * 2000).pipe(take(3))),
take(2)
);
const result = higherOrder.pipe(combineLatestAll());
result.subscribe(x => console.log(x)); combineLatestAll(): OperatorFunction<ObservableInput<T>, T[]>There are no parameters.
OperatorFunction<ObservableInput<T>, T[]>
combineLatestAll(): OperatorFunction<any, T[]>There are no parameters.
OperatorFunction<any, T[]>
combineLatestAll(project: (...values: T[]) => R): OperatorFunction<ObservableInput<T>, R> project | (...values: T[]) => R |
OperatorFunction<ObservableInput<T>, R>
combineLatestAll(project: (...values: any[]) => R): OperatorFunction<any, R> project | (...values: any[]) => R |
OperatorFunction<any, R>
© 2015–2022 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.
Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0.
https://rxjs.dev/api/operators/combineLatestAll