Reactive Extensions [An Introduction for .NET Developers]

preview_player
Показать описание
In my last video, I discussed Events and Delegates in .NET. Whenever we implement the Event/Delegate combination, we use an observer pattern.

Hence Reactive extension is the natural progression in terms of the next step for implementing Observer patterns. Reactive Extension is a combination of Observer pattern with iterator pattern. The main interface used in Reactive extension is IObservable, which is also known as dual of IEnumerable. Meaning IEnumerable deals with a pull for data in rest, whereas IObservable deals with the push of data or data in motion.

Using Reactive extension we can easily create event streams, compose and transform the stream of events with a similar pattern as LINQ. Anywhere we can use an observable pattern we can use Rx.

The two main interfaces which are building blocks of Rx are IObservable and IObserver. However, we are going to use ISubject, which significantly simplifies the implementation.

Рекомендации по теме
Комментарии
Автор

How do I unsubscribe from the subject.

rahulchakrabarty
Автор

Can you do Reactive Extensions with Blazor? Like a parent component state will be modified then all child components that are subscribed will be updated? Great work btw.

rafaelfabro
Автор

Thanks and please do a video about the reactive programming with webapi

akalankagajasinghe