mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(core): Removes unused flag for onDestroy
Eliminates an unnecessary configuration flag
(cherry picked from commit 2ad1b5979f)
This commit is contained in:
parent
3140b87fd6
commit
36f4c9b299
1 changed files with 0 additions and 8 deletions
|
|
@ -12,8 +12,6 @@ import {LView} from '../render3/interfaces/view';
|
|||
import {getLView} from '../render3/state';
|
||||
import {removeLViewOnDestroy, storeLViewOnDestroy} from '../render3/util/view_utils';
|
||||
|
||||
const EXECUTE_CALLBACK_IF_ALREADY_DESTROYED = false;
|
||||
|
||||
/**
|
||||
* `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior.
|
||||
* The scope of this destruction depends on where `DestroyRef` is injected. If `DestroyRef`
|
||||
|
|
@ -84,12 +82,6 @@ export class NodeInjectorDestroyRef extends DestroyRef {
|
|||
override onDestroy(callback: () => void): () => void {
|
||||
const lView = this._lView;
|
||||
|
||||
// TODO(atscott): Remove once g3 cleanup is complete
|
||||
if (EXECUTE_CALLBACK_IF_ALREADY_DESTROYED && isDestroyed(lView)) {
|
||||
callback();
|
||||
return () => {};
|
||||
}
|
||||
|
||||
storeLViewOnDestroy(lView, callback);
|
||||
return () => removeLViewOnDestroy(lView, callback);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue