Reactive programming in Angular
The observer pattern stands at the core of what we know as reactive programming. The most basic implementation of a reactive script encompasses several concepts that we need to become familiar with:
- An observable
- An observer
- A timeline
- A stream of events
- A set of composable operators
Sound daunting? It isn't. The big challenge here is to change our mindset and learn to think reactively, which is the primary goal of this section.
Reactive programming entails applying asynchronous subscriptions and transformations to observable streams of events.
Let's explain it through a more descriptive example. Think about an interaction device such as a keyboard. It has keys that the user presses. Each one of those keystrokes triggers a specific keyboard event, such as keyUp. The keyUp event features a wide range of metadata, including—but not limited to—the numeric code of the specific key the user pressed...