What is the practical difference among all of these Reactive Observable extensions?

后端 未结 2 1554
执念已碎
执念已碎 2021-02-09 11:21

Given a BehaviorSubject, what is the practical difference between calling all of these different functions on it?

  • First()
  • Last()
  • LatestValue()
2条回答
  •  萌比男神i
    2021-02-09 11:50

    Thanks @RichardHein for the great answer.

    The blocking extension methods should really be moved into their own namespace, so the developer has to specifically choose to include them for a project (or specifically a CS file). You add a ton of complexity with Rx, and by accidentally using a blocking method you're basically devolving back to IList/IEnumerable.

    I think this is the biggest mistake the Rx team made, IOW I think by including these by default they missed the 'pit of success' with Rx. Fix this and I'd call Rx the API of choice when moving beyond single-threaded + async in C# (i.e. why .NET is more powerful than say NodeJS).

提交回复
热议问题