Question

I have an IObservable, I am looking for a way to do something like this

var referenceBack2 = source.Ref(2);

say I have this sequence coming in source

A-B-C-D-E-F-G-H

The referenceBack2 will not do OnNext() on A until B comes through source, will not render B until C comes in, and at the end it will render G. H will wait forever because A is hot observable and no element is coming after H.

Was it helpful?

Solution

I think this will work:

var referenceBack2 = source.Zip(source.Skip(1), (a, b) => a)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top