combineLatestWith
is a function that allows combining the latest emissions from multiple observables into a single observable. Here's how to use it:
index.tsx261 chars13 lines
In the above example, we have two observables obs1$
and obs2$
emitting numbers and characters respectively. We use combineLatestWith
to combine the latest emissions from both observables into a single observable. The subscribe
function logs the latest emission from both observables, which in this case is the number 3
and the character C
.
Note that the combineLatestWith
function returns a new observable, which means the source observables (obs1$
and obs2$
in this case) are left unchanged.
gistlibby LogSnag