DEV Community

Discussion on: RxJS subscription management with Angular

Collapse
 
tamusjroyce profile image
tamusjroyce

Anything in javascript that could cause a memory leak should be avoided like the plague. It shouldn’t be handled tediously.

The solutions I have found (realist, not being purely negative) is to have a class inherit from event emitters and inject what you want to do with the pipe. I can’t share the code, as I did it on my companies time. But there are examples. And because it is angular wrapped, it handles all the tedious setup. And supports async via the constructor.

The other option is to switch to svelte. Try its reactive pattern that gets compiled differently based on how it is used. It is quite impressive.