Reactive Observable Subscription Disposal

前端 未结 4 968
野性不改
野性不改 2020-12-05 10:25

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         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 11:13

    The Take function will do exactly what you are looking for. In this case, Take(1).

提交回复
热议问题