core/src/plugin/decorators/auto.ts

15 lines
292 B
TypeScript
Raw Normal View History

2020-11-21 15:41:08 +00:00
2020-11-29 19:23:43 +00:00
/**
* Automatically execute method on plugin initialization
*/
2020-11-21 15:41:08 +00:00
export function Auto(): (...args: any[]) => void {
return (
target: any,
propertyKey: string,
descriptor: PropertyDescriptor,
) => {
descriptor.value.prototype.__autoexec = 1;
return descriptor;
};
}