Created
August 20, 2016 11:35
-
-
Save patroza/60fd3620b0a8c635ee7f8aeb9917a217 to your computer and use it in GitHub Desktop.
This file contains 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
public static IObservable<TResult> FromTdf<T, TResult>(this IObservable<T> source, | |
Func<IPropagatorBlock<T, TResult>> blockFactory) => Observable.Create<TResult>(observer => { | |
var block = blockFactory(); | |
var dsp1 = block.AsObservable().Subscribe(observer.OnNext); | |
var dsp2 = source.Subscribe(block.AsObserver()); | |
return new CompositeDisposable {dsp2, dsp1}; | |
}); | |
public static IObservable<TResult> FromTdf<T, TResult>(this IObservable<T> source, | |
IPropagatorBlock<T, TResult> block) => source.FromTdf(() => block); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment