Combination Operators
Combine streams with combineLatest and forkJoin.
Why combine streams
Real apps coordinate multiple async sources: several HTTP calls, a form value plus a filter, a click plus the latest state. Combination operators merge multiple observables into one.
combineLatest
combineLatest emits an array of the latest value from each source whenever any source emits — after all have emitted at least once.
import { combineLatest } from 'rxjs';
combineLatest([name$, age$]).subscribe(
([name, age]) => console.log(name, age)
);
// re-emits whenever name$ OR age$ changesAll lessons in this course
- Transformation Operators
- Filtering Operators
- Combination Operators
- Error Handling Operators