Module corky.hooks
Hooks for Corky modules.
Hooks provide a way for modules to have certain functions called automatically at certain points. However, this module does not define any hooks itself. See the main module for the available hooks.
Info:
Functions
add (name, hook) | Register a function for a hook. |
run (name) | Run all registered functions for the specified hook. |
Local Tables
hooks | Stores the hooks. |
Functions
- add (name, hook) line 50
-
Register a function for a hook.
Parameters:
- name string The name of the hook.
- hook function Function to call when the hook is executed. It will be called without any parameters, its return value will be ignored.
- run (name) line 70
-
Run all registered functions for the specified hook.
Functions will be run in the order they were added. They will be called without any parameters, and their return value will be ignored. This function does nothing if no function has been registered for the specified hook.
Parameters:
- name string The name of the hook.