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:

  • Copyright: © 2015-2017 Stefan Göbel
  • Release: 2017033001
  • License: GPLv3
  • Author: Stefan Göbel [⌂] [✉]

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.

Local Tables

hooks line 38
Stores the hooks.

The keys are the names of the hooks (arbitrary strings), the values are tables (arrays) containing a list of functions to run when the hook is executed. To add a hook handler use add().

generated by LDoc 1.4.6 Last updated 2019-02-14 20:51:07