DEV Community

Discussion on: 7 Deadly Sins of Angular

Collapse
layzee profile image
Lars Gyrup Brink Nielsen

Hi Ray,

Thank you for your feedback. Personally, I use container components and presentational components. This solves the issue with multiple subscriptions since the container component subscribes to the observable exactly once. It also solves the issue you mention with observable subscription time since the presentational component is not aware of observable values.

Collapse
layzee profile image
Lars Gyrup Brink Nielsen

Your solution comes with a footgun. If the takeUntil operation is placed in the wrong position of the observable pipeline, it will lead to unforeseen consequences such as memory leaks and duplicate side effects.