Combining Observables
These are operators used to combine multiple Observables.
The combine operator
Combining the latest-emitted value from two or more Observables is done by calling one of these methods:
combineLatest
: Emits an item that aggregates the latest values of each of the sourceswithLatestFrom
: Merges the given Observable into the current instance
The following example (runs forever) shows the result of combining two interval observables with different timespans–the first emits every 6 ms, the other every 10 ms:
The execution of the preceding code needs to be stopped by pressing Ctrl + C since it creates an infinite list. The output is as expected, it contains the combined values of both sequences based on the creating timestamp.
The join operator
Combining two Observables based on a given window can be done by calling one of the following methods:
join
: Joins the items emitted by two Observables based on overlapping durations using an aggregation functiongroupJoin
: Joins the items emitted...