Advantages of .NET Rx over classic events?

前端 未结 4 482
没有蜡笔的小新
没有蜡笔的小新 2021-02-01 16:24

.NET 4.0 beta 2 has introduced the IObservable and IObserver interfaces.

What are the advantages compared to classic .NET events? Doesn\'t this solve the same problem?<

4条回答
  •  心在旅途
    2021-02-01 17:08

    I'm not sure of the advantages, but I see the following differences with classic .NET events:

    error notifications

    Classic events would require a separate event for this, or an EventArgs class with an Error property that needs to be checked.

    end-of-notifications notification

    Classic events would require a separate event for this or an EventArgs class with a Final property that needs to be checked.

提交回复
热议问题