The events namespace contains functions that are used for working with daochook events.
Functions exposed by this namespace are accessed via the prefix: hook.events.
registerRegisters a new callback function to the given event.
1boolean hook.events.register(event_name, event_alias, callback_func);
| Parameter Name | Type | Description |
|---|---|---|
event_name | string | The name of the event to register this callback to. |
event_alias | string | The alias for this callback. |
callback_func | function | The function to invoke when the event is raised. |
| Returns |
|---|
| (boolean) True on success, false otherwise. |
unregisterUnregisters an existing callback from the given event.
1boolean hook.events.unregister(event_name, event_alias);
| Parameter Name | Type | Description |
|---|---|---|
event_name | string | The name of the event to unregister the existing callback for. |
event_alias | string | The alias for the existing callback to unregister. |
| Returns |
|---|
| (boolean) True on success, false otherwise. |