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