public static IDisposable Subscribe <TSource, TProperty>(this IObservable <TSource> source, IObservableGetProperty <TProperty> property) { if (source == null) { throw new ArgumentNullException("source"); } if (property == null) { throw new ArgumentNullException("property"); } return(source.Subscribe(Observer2.Create <TSource>(o => property.OnNext()))); }
public static IObservable <TSource> Do <TSource, TProperty>(this IObservable <TSource> source, IObservableGetProperty <TProperty> property) { if (source == null) { throw new ArgumentNullException("source"); } if (property == null) { throw new ArgumentNullException("property"); } return(source.ChainNext <TSource, TSource>(obs => o => { property.OnNext(); obs.OnNext(o); })); }