If I have access to an IObservable that I know is only ever going to return one item, will this work and is it the best usage pattern?
IDisposable disposable = null;
disposable = myObservable.Subscribe(x =>
if (disposable != null)
Disclaimer: I'm also still learning Rx. So I'm not really an expert but I believe the disposable returned by
Subscribe will only unsubscribe the subscription. Also if the source completes, like in your case, the unsubscription is done automatically. So I think the
Dispose there is redundant and can be safely removed.
See the answer to this question for more info.