We may have experienced creating non-reactive services, as our CustomerService is, but now we need to create our own reactive service. In this section, we will learn how we can transform our services to become reactive.
Creating reactive services
Understanding subscribers and publishers
First, we need to understand a core component in reactive programming, the subscribe and publish mechanism. Reactive programming is based on the event-model mechanism, in which a set of events are triggered and dispatched to whoever needs them. This abstract concept can easily be understood with how we handle actions from users in almost all UI Frameworks.
Let's think that we want to react to a UI action, for example, pressing a button...