mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
In this commit, we introduce the ability to check whether `lView` has already been destroyed in `NodeInjectorDestroyRef`. If the `lView` is already destroyed, we call the on-destroy callback immediately, without trying to register it to be called later. This ensures that any necessary cleanup is handled gracefully and provides better reliability in managing resources. One of the use cases is `takeUntilDestroyed`, which aims to replace `takeUntil` in existing applications. While `takeUntil` can be safely called once the view is destroyed—resulting in no errors and finalizing the subscription depending on whether a subject or replay subject is used—replacing it with `takeUntilDestroyed` introduces a breaking change, as it throws an error if the `lView` is destroyed. Related issue: #54527 PR Close #58008 |
||
|---|---|---|
| .. | ||
| global | ||
| primitives | ||
| rxjs-interop | ||
| schematics | ||
| src | ||
| test | ||
| testing | ||
| BUILD.bazel | ||
| index.ts | ||
| package.json | ||
| PACKAGE.md | ||
| public_api.ts | ||