A mapping of hook events which have functions registered to them.
Register a callback handler which should be triggered when a hook is triggered.
The unique name of the hooked event
The callback function which should be triggered when the hook event occurs
Options which customize hook registration
Only trigger the hooked function once
An ID number of the hooked function which can be used to turn off the hook later
Register a callback handler for an event which is only triggered once the first time the event occurs. An alias for Hooks.on with {once: true}
The unique name of the hooked event
The callback function which should be triggered when the hook event occurs
An ID number of the hooked function which can be used to turn off the hook later
Unregister a callback handler for a particular hook event
The unique name of the hooked event
The function, or ID number for the function, that should be turned off
Call all hook listeners in the order in which they were registered Hooks called this way can not be handled by returning false and will always trigger every hook callback.
The hook being triggered
Arguments passed to the hook callback functions
Were all hooks called without execution being prevented?
Call hook listeners in the order in which they were registered. Continue calling hooks until either all have been called or one returns false.
Hook listeners which return false denote that the original event has been adequately handled and no further hooks should be called.
The hook being triggered
Arguments passed to the hook callback functions
Were all hooks called without execution being prevented?
Notify subscribers that an error has occurred within foundry.
The method where the error was caught.
The error.
Additional options to configure behaviour.
Call a hooked function using provided arguments and perhaps unregister it.
The hooked function entry
Arguments to be passed
A mapping of hooked functions by their assigned ID
An incrementing counter for assigned hooked function IDs
A simple event framework used throughout Foundry Virtual Tabletop. When key actions or events occur, a "hook" is defined where user-defined callback functions can execute. This class manages the registration and execution of hooked callback functions.