Frage

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.

War es hilfreich?

Lösung

I think this will work:

var referenceBack2 = source.Zip(source.Skip(1), (a, b) => a)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top