The Best Way To Unsubscribe RxJS Observables In The Angular Applications!
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.