Stone.js API
    Preparing search index...

    Variable HookConst

    Hook: <T extends Function = Function>(name: HookName) => MethodDecorator

    Hook decorator to mark a method as a lifecycle hook And automatically add it to the global lifecycle hook registry.

    Type Declaration

      • <T extends Function = Function>(name: HookName): MethodDecorator
      • Type Parameters

        • T extends Function = Function

        Parameters

        • name: HookName

          The name of the lifecycle hook.

        Returns MethodDecorator

        A class decorator function that sets the metadata using the provided options.

    class MyClass {
    // ...
    @Hook('onPreparingPage')
    onPreparingPage () {}
    }