The Observable Object
Let's learn about an Observable object, its characteristics, and the design patterns that are used to define it.
We'll cover the following
- The Observable object
- The next( ) handler
- The complete( ) handler
- The error( ) handler
- Example: Relationship between the Observable and the Observer
- Example 1: Run an event without a reactive approach
- Example 2: Run an event with a reactive approach
- Comparison between the reactive and non-reactive approach
- Observable in layman’s terms
- The structure of an Observable object
The Observable object
When an Observable object is created, we register an Observer object with the Observable. Then, as the Observable receives items, it calls all its subscribed Observer’s methods. There are three handler methods that the Observable can call:
Get hands-on with 1400+ tech skills courses.