mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(core): Removes unused flag for onDestroy
Eliminates an unnecessary configuration flag
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user