I’d like to be able to add an extension method like this:
IObservable<T> AfterSubscriber(this IObservable<T> observable, Action<T> action)
Where:
var subj = new Subject<int>();
subj.
AfterSubscriber(i => Console.WriteLine("Second")).
Subscribe(i => Console.WriteLine("First"));
subj.OnNext(1);
Produces the output:
First
Second
Any suggestions on how to implement the above method? Are there any built in methods I can use? (Assumption: synchronous/immediate subscription)
How about this implementation?