public static IAsyncObservable <TSource> Do <TSource>(this IAsyncObservable <TSource> source, IAsyncObserver <TSource> observer) { if (source == null) { throw new ArgumentNullException(nameof(source)); } if (observer == null) { throw new ArgumentNullException(nameof(observer)); } return(Create <TSource>(target => source.SubscribeSafeAsync(AsyncObserver.Do(target, observer)))); }
public static IAsyncObservable <TSource> Do <TSource>(this IAsyncObservable <TSource> source, Func <Task> onCompleted) { if (source == null) { throw new ArgumentNullException(nameof(source)); } if (onCompleted == null) { throw new ArgumentNullException(nameof(onCompleted)); } return(Create <TSource>(target => source.SubscribeSafeAsync(AsyncObserver.Do(target, onCompleted)))); }
public static IAsyncObservable <TSource> Do <TSource>(this IAsyncObservable <TSource> source, Action <Exception> onError) { if (source == null) { throw new ArgumentNullException(nameof(source)); } if (onError == null) { throw new ArgumentNullException(nameof(onError)); } return(Create( source, onError, (source, onError, target) => source.SubscribeSafeAsync(AsyncObserver.Do(target, onError)))); }
public static IAsyncObservable <TSource> Do <TSource>(this IAsyncObservable <TSource> source, Func <TSource, ValueTask> onNext) { if (source == null) { throw new ArgumentNullException(nameof(source)); } if (onNext == null) { throw new ArgumentNullException(nameof(onNext)); } return(Create( source, onNext, (source, onNext, target) => source.SubscribeSafeAsync(AsyncObserver.Do(target, onNext)))); }
public static IAsyncObservable <TSource> Do <TSource>(this IAsyncObservable <TSource> source, Action <TSource> onNext, Action <Exception> onError, Action onCompleted) { if (source == null) { throw new ArgumentNullException(nameof(source)); } if (onNext == null) { throw new ArgumentNullException(nameof(onNext)); } if (onError == null) { throw new ArgumentNullException(nameof(onError)); } if (onCompleted == null) { throw new ArgumentNullException(nameof(onCompleted)); } return(Create( source, (onNext, onError, onCompleted), (source, state, target) => source.SubscribeSafeAsync(AsyncObserver.Do(target, state.onNext, state.onError, state.onCompleted)))); }