Question

Say we have two hot observables of integers, and we get a resulting one like this

var result = Observable.Zip(observable1, observable2);

My question is, say an element comes through observable1, does the result wait for a matching pair in observable2 before calling observer or it takes the last value from observer2?

Was it helpful?

Solution

Zip waits for a pair to come through.

If you want to use the latest value from observer2 when a value comes through observable1, you should use CombineLatest.

You can also find more info on combining sequences in the Intro to Rx chapter on that topic.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top