コード例 #1
0
        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))));
        }
コード例 #2
0
        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))));
        }