Hook

core. Hook

Allows observers to tap into to a specific piece of code, and execute their own arbitrary code

Constructor

new Hook()

Source:

Members

(static) Types :Object

Source:
Properties:
Name Type Description
Parallel String
Series String
Types of supported Hook
Type:
  • Object

hasObservers

Source:
Whether this hook has any observer functions

Methods

(async) invoke(…args) → {Promise}

Source:
Invokes all observers
Parameters:
Name Type Attributes Description
args * <repeatable>
Arguments to be passed to observers
Returns:
Type
Promise

onInvoke()

Source:
Returns a promise which is resolved when the hook is successfully invoked. If hook fails, the promise is rejected with the error
Returns:
Promise

tap(observer)

Source:
Adds an observer to the hook
Parameters:
Name Type Description
observer function Callback to be called when the hook is invoked

untap(observer)

Source:
Removes an observer from the hook
Parameters:
Name Type Description
observer function