Class HookHandler<HookConfig>Private

Type Parameters

  • HookConfig extends {}

Constructors

Properties

#eventTarget: object
#listeners: MultiMap<PropertyKey, {
    callback: HookConfig[keyof HookConfig];
    listenerName: string | Nullish;
}> = ...

Type declaration

#onRunHook: undefined | OnRunHook<HookConfig>
#validHookNames: (keyof HookConfig)[]

Methods

  • Registers a listener for a hook.

    Returns a function that can be called to deregister the listener.

    Type Parameters

    • HookName extends string | number | symbol

    Parameters

    Returns (() => void)

      • (): void
      • Returns void