IObservable vs Plain Events or Why Should I use IObservable?

后端 未结 1 1413
闹比i
闹比i 2020-12-23 12:47

Microsoft introduced the IObservable interface to the BCL with .NET Framework 4, and I thought, \"Great, finally, I must use it!\" So I dug deep and read posts and

相关标签:
1条回答
  • 2020-12-23 13:08

    Observable is the cornerstone of the Rx library. They provide pretty much all the implementations and operators you'll need. The idea behind IObservable<T> and Rx is not just the "handling" of events, but enabling "LINQ to Events." So you can easily compose "event streams," which gives you a lot of power compared to regular event handling.

    Note that the sample MSDN implementation of IObservable<T> is incorrect; the doc team has been notified.

    0 讨论(0)
提交回复
热议问题