combine
Combine two observables with a map function and an optional pre-treatment.
You can use the pre-treatment to add a filter, a distinctUntilChanged, or any other operator
that can be used in a pipe, applied to each source before it is combined.
Available since v1.0.1
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
source1 | Observable<T> | First source of data. |
source2 | Observable<U> | Second source of data. |
map | (c: readonly [T, U]) => R | Way to combine the two latest values into the result. |
options | combineOptions<T, U> | Optional. preTreatment — an operator (filter, distinctUntilChanged, …) applied to the paired [T, U] values before map runs. |
Returns
Section titled “Returns”Observable<R> — An observable that emits the result of map every time either source emits.
