Function: Hook()
Function: Hook()
function Hook<T>(name): MethodDecorator;
Hook decorator to mark a method as a lifecycle hook And automatically add it to the global lifecycle hook registry.
Type Parameters
T
T
extends Function
= Function
Parameters
name
The name of the lifecycle hook.
Returns
MethodDecorator
A class decorator function that sets the metadata using the provided options.
Example
class MyClass {
// ...
@Hook('onPreparingPage')
onPreparingPage () {}
}