Observable trapped me in memory leak
summary
An Angular component subscribes to a service Observable and never unsubscribes, causing a memory leak; the fix is concrete: create a Subject<void> onDestroy, pipe every stream through takeUntil pattern, and call next/complete in ngOnDestroy lifecycle so all subscriptions drop. Example code shows subscribe → store nothing → leak, then refactor to pipe(takeUntil(this.onDestroy)) and push a value on destroy and the leak disappears.
AI-written summary · about
related talks
34mBad Practices, how you should NOT do in Angular world
05mThe Memory Leak Brain Drain
09mCommon Angular Gotchas
32mI'm Watching You: A Tale of Observables
53mRxJS Observables in Angular
35mBad Practices, what NOT to do in Angular
19mTuning Your Angular Application
41mThe most infamous code smells in Angular Applications
