The Best Way To Unsubscribe RxJS Observables In The Angular Applications!

Tomas Trajan
Angular In Depth
Published in
13 min readJan 8, 2019

--

An epic journey to RxJS .subscribe()-less Angular applications by 🐻 at Mount Cook (New Zealand)

AngularInDepth is moving away from Medium. More recent articles are hosted on the new platform inDepth.dev. Thanks for being part of indepth movement!

A Short Introduction To RxJS Observables

(feel free to skip this part and get straight to the main course🍔)

The RxJS (aka Observable-s ) is a rather new-ish technology in the frontend engineering space. Made popular mostly by its inclusion in the core Angular APIs. It proved to be a very powerful tool when dealing with the collections of asynchronous events.

We can think of RxJS Observable as an potentially infinite async Array with all the conveniences we’re used to like filter or map and much more…

Evolution Of Async Concepts

In the beginning, we started with simple callbacks. A callback is a function we pass as an argument to some other function. The callback will be then executed later, when something is done.

--

--

Tomas Trajan
Angular In Depth

👋 I build, teach, write & speak about #Angular & #NgRx for enterprises 👨‍💻 Google Developer Expert #GDE 👨‍🏫 @AngularZurich meetup co-organizer