RxJS: Avoiding takeUntil Leaks

Nicholas Jamieson
3 min readMay 27, 2018
Photo by Tim Gouw on Unsplash

Using the takeUntil operator to automatically unsubscribe from an observable is a mechanism that’s explained in Ben Lesh’s Don’t Unsubscribe article.

It’s also the basis of a generally-accepted pattern for unsubscribing upon an Angular component’s destruction.

For the mechanism to be effective, operators have to be applied in a specific sequence. And, recently, I’ve seen code that…

--

--

Nicholas Jamieson

RxJS core team member; front-end developer; mentor; speaker; open-source contributor