@paperbits/common
Version:
Paperbits common components.
15 lines (11 loc) • 421 B
text/typescript
import "reflect-metadata";
export function OnDestroyed(name?: string): MethodDecorator {
return function (target: any, propertyKey: string) {
let props: string[] = Reflect.getMetadata("ondestroyed", target.constructor);
if (!props) {
props = [];
}
props.push(propertyKey);
Reflect.defineMetadata("ondestroyed", props, target.constructor);
};
}