The ReactiveX library

The Rx library is a cross-platform library that uses the observer pattern to help developers manage asynchronous data changes over time. Simply put, ReactiveX is a library that allows us to create and manipulate Observable objects. In Angular 2 projects, we use the RxJS library, which is basically a JavaScript version of the ReactiveX library. If you look closely at the previous chapter, you'll be able to see that we already set it up and even used it in our authentication service. We did that by installing it using npm:

...
"rxjs": "5.0.0-beta.12",
...

We imported it in our entities as follows:

...
import 'rxjs/Rx';

We had to do this because the Angular team chose to use Observables quite extensively. And one of our first ...

Get MEAN Web Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.