public static IAsyncObservable <TSource> DistinctUntilChanged <TSource>(IAsyncObservable <TSource> source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } return(Create <TSource>(observer => source.SubscribeSafeAsync(AsyncObserver.DistinctUntilChanged(observer)))); }
public static IAsyncObservable <TSource> DistinctUntilChanged <TSource, TKey>(IAsyncObservable <TSource> source, Func <TSource, Task <TKey> > keySelector) { if (source == null) { throw new ArgumentNullException(nameof(source)); } if (keySelector == null) { throw new ArgumentNullException(nameof(keySelector)); } return(Create <TSource>(observer => source.SubscribeSafeAsync(AsyncObserver.DistinctUntilChanged(observer, keySelector)))); }