What is the Action returned by the subscribe parameter of IObservable.Create actually for?
- by James Hay
The method definition of IObservable.Create is:
public static IObservable<TSource> Create<TSource>(
Func<IObserver<TSource>, Action> subscribe
)
I get that the function is called once the observable is subscribed to, where by I can then call OnNext, OnError and OnComplete on the observer. But why do I need to return an Action from the subscibe parameter and when will it actually be called?