Bad Practices, how you should NOT do in Angular world
summary
Shows concrete anti-patterns and fixes: a one-second timer demo proves naive subscribe causes memory leaks and duplicated work, fixed by storing Subscription and unsubscribing on destroy or using takeUntil with a component Subject, or by using async pipe but noting it triggers change detection and can double requests when multiple bindings exist. Explains RxJS differences between share() / publish + refCount / shareReplay, warns about shareReplay memory leaks without refCount, advocates catchError defaults, TypeScript interfaces to catch rename bugs, and supplies a runnable GitHub repo and slides.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 2:05Learning new things
- 3:31Unstructured code mistakes
- 5:18TypeScript any problems
- 7:44Memory leaks from subscriptions
- 10:14Take operator solution
- 12:44TakeUntil approach
- 14:06ngx-take-until-destroy library
- 15:13Async pipe problems
- 17:19Multiple async pipes
- 18:24Share for subscription splitting
- 20:55Share and multicasting
- 23:44Share vs publish
- 25:29Replay operator features
- 26:55Error handling in subscriptions
- 28:21Linter for subscriptions
- 29:48Template function calls problems
- 31:56Optimization with pipes
- 33:21Summary and Q&A








