fromEvent()

We have mentioned rich composition a few times already and the power of making everything into an Observable. We have turned promises and into Observables, which have made everything into streams of data, making the whole situation more easy to reason about. What we mean by that is, when every async concept is being turned into an Observable, we are suddenly able to think about them in the same way. Operators that can be applied to mouse-clicks can also be applied to AJAX requests and so on.

To add to this, we can even make UI events into Observables. By using the .fromEvent() operator, we are able to take an element and its corresponding event and make that an Observable. This is true power at our fingertips, which allows us ...

Get Architecting Angular Applications with Redux, RxJS, and NgRx 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.