Events versus observables

Being developers, we should all be quite familiar with events. Most developers have been creating events since we started writing code. In fact, if you have even dropped a button control on a form and double-clicked the button to create the method that handles the click of the button, you have created an event. In .NET, we can declare events using the event keyword, publish to the event by invoking it, and subscribe to that event by adding a handler to the event. We, therefore, have the following operations:

  • Declare
  • Publish
  • Subscribe

With Rx, we have a similar structure where we declare a datastream, publish data to that stream, and subscribe to it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.24.106