Angular 16 takeUntilDestroyed #244
Replies: 7 comments
-
Haha, nope Implementations are different from a technical perspective since In my large codebases, I used |
Beta Was this translation helpful? Give feedback.
-
Ah, alright! Thanks for the details. I just tested to migrate a few components, and it is a little tricky. :D
Considering performance when talking about 1000x (we have a little less), would you say one is better tho “until-destroy” hooks into the constructor and has “one more” import? Or in your case, why did you choose to use Just trying to figure out which way we go, especially when Signals are coming, I guess that |
Beta Was this translation helpful? Give feedback.
-
I see there was already a try on until-destroy side to make something like that, in #122. |
Beta Was this translation helpful? Give feedback.
-
The class App {
destroyRef = inject(DestroyRef);
constructor() {
// Can be used w/o arguments.
of(true).pipe(takeUntilDestroyed()).subscribe();
}
ngOnInit() {
// Requires `DestroyRef`
of(true).pipe(takeUntilDestroyed(this.destroyRef)).subscribe();
}
} |
Beta Was this translation helpful? Give feedback.
-
I don't think there's anything related to performance in this case since both operators are essentially piping source observables with |
Beta Was this translation helpful? Give feedback.
-
Thanks for the example. OK, sounds like in general it would be a good "best-practise" to move to |
Beta Was this translation helpful? Give feedback.
-
I don't understand: from the docs, |
Beta Was this translation helpful? Give feedback.
-
Just a technical question: are the implementations different from this pipe and Angular 16 newest rxjs-interop
takeUntilDestroyed
? I can see that NG#s version does not need(this)
, so I am unsure.Or, had you merged your outstanding work here into the Angular project?
Beta Was this translation helpful? Give feedback.
All reactions