ngx-decorate
Version:
Useful decorators for Angular 2 and above
12 lines • 512 B
JavaScript
import { defineImmutable } from './lib/defineProp';
import { HookManager } from './lib/HookManager';
import { _destroyed } from './lib/symbols';
import { destroyed } from './processors/destroyed';
/** Set the given property to true when the component is destroyed */
export function TrackDestroyed() {
return function (target, value) {
defineImmutable(target, _destroyed, value);
HookManager.for(target).add(1 /* PRE_DESTROY */, destroyed);
};
}
//# sourceMappingURL=TrackDestroyed.js.map