Reactive programming requires us to change the way that we think about events in an application. Reactive programming requires us to think about events as a stream of values. For example, a mouse click event can be represented as a stream of data. Every click event generates a new value in the data stream. In reactive programming, we can use the stream of data to query and manipulate the values in the stream.
We are going to use the Reactive Extensions Library for JavaScript (RxJS). RxJS provides us with an implementation of the observable pattern, as well as many operators and utilities that allow us to manipulate the observables. RxJS also includes helpers that allow us to create observables given different data types.
We can install RxJS using npm:
npm install rxjs
The observable pattern is also known as the observable sequence pattern, which is the...