Created
May 20, 2014 14:15
-
-
Save LeeCampbell/ae96639175b478459b69 to your computer and use it in GitHub Desktop.
Rx delta without Zip/DualSubscription
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//From James World - http://social.msdn.microsoft.com/Forums/en-US/dfa87af8-b7dd-4fb5-abe2-99348d3e27e1/compare-two-object-graphs-and-get-differences?forum=rx | |
public static IObservable<Tuple<TSource, TSource>> PairWithPrevious<TSource>(this IObservable<TSource> source) | |
{ | |
return source.Scan( | |
Tuple.Create(default(TSource), default(TSource)), | |
(acc, current) => Tuple.Create(acc.Item2, current)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment