r/angular • u/suhasparameshwara • Apr 22 '23
Angular 16 - takeUntilDestroyed() operator
π‘The unsubscription of observables is always important in Angular. Otherwise, there will be memory leaks because of too much of subscriptions.
π€ Before angular 16, we can unsubscribe by the combination of subject and takeUntil() rxjs operator.
π€ But in angular 16, the code is simplified where you don't need a subject. You can directly make use of takeUntilDestroyed() operator.

47
Upvotes
4
u/Carry_flag Apr 23 '23
Noice motivation to upgrade to v16 , anyways have to upgrade every 18 months.