in Angular
@edbzn
@edbzn
Subscription ? 🤨
@edbzn
It’s an object that holds the Observable execution.
@edbzn
@edbzn
The component get destroyed
but the subscription lives on.
@edbzn
✖️ Avoid nested .subscribe().
@edbzn
✔️ Consider flattening operators instead.
@edbzn
✖️ Avoid .subscribe() in constructors.
@edbzn
✔️ Use lifecycle hooks instead.
@edbzn
✖️ Avoid logic in .subscribe().
Having logic in subscribe is usually an indicator that you're not using RxJS to its best potential.
✖️ Avoid subscription in services.
@edbzn
✔️ Reduce view subscriptions.
@edbzn
✖️ Don’t pass streams to components directly.
@edbzn
@edbzn
@edbzn
@edbzn
Edouard Bozon
Angular, RxJS, NgRx, Node
🚴♂️ ⛷ 🍻
@edbzn