Class: HookContainer

HookContainer()

A simple hook system. Allows registering functions to be called on arbitrary events/hooks, and allows calling all functions registered for each event/hook.

Constructor

new HookContainer()

Source:

Methods

add(hookName, hookFunction) → {function}

Register a function to be called upon a specific hook.
Parameters:
Name Type Description
hookName string The name of the hook this method will be called on.
hookFunction function A function that will be called when the specified hook is called.
Source:
Returns:
the function passed into the hook
Type
function

(async) call(hookName)

Call all functions registered for a specific hook.
Parameters:
Name Type Description
hookName string The hook to call.
...args Remaining arguments are passed to the hook functions.
Source:

remove(hookName, hookFunction)

Remove a function from being called upon a specific hook.
Parameters:
Name Type Description
hookName string The name of the hook to remove from.
hookFunction function The function to remove from the hook.
Source: