Lib signal
Signal library.
Based on hump.signal.
Functions
| new () | Creates a new signal registry that is independent of the default registry. |
| register (signal, func) | Creates a new signal registry that is independent of the default registry. |
| emit (signal, ...) | Calls all functions bound to the specified signal with the supplied arguments. |
| remove (signal, ...) | Unbinds (removes) functions from the specified signal. |
| clear (signal) | Removes all functions from the specified signal. |
| emitPattern (pattern, ...) | Calls all functions bound to the signals matching the string pattern. |
| removePattern (signal, ...) | Unbinds (removes) functions from the signals matching the string pattern. |
| clearPattern (signal) | Removes all functions from the signals matching the string pattern. |
Functions
- new ()
-
Creates a new signal registry that is independent of the default registry.
Returns:
-
table
new signal registery
- register (signal, func)
-
Creates a new signal registry that is independent of the default registry.
Parameters:
- signal string signal identifier
- func function function to register
Returns:
-
function
function handle
- emit (signal, ...)
-
Calls all functions bound to the specified signal with the supplied arguments.
Parameters:
- signal string signal identifier
- ... mixed function parameters
- remove (signal, ...)
-
Unbinds (removes) functions from the specified signal.
Parameters:
- signal string signal identifier
- ... functions list of function handles to remove
- clear (signal)
-
Removes all functions from the specified signal.
Parameters:
- signal string signal identifier
- emitPattern (pattern, ...)
-
Calls all functions bound to the signals matching the string pattern.
Parameters:
- pattern string signal identifier pattern
- ... mixed function parameters
- removePattern (signal, ...)
-
Unbinds (removes) functions from the signals matching the string pattern.
Parameters:
- signal string signal identifier pattern
- ... functions list of function handles to remove
- clearPattern (signal)
-
Removes all functions from the signals matching the string pattern.
Parameters:
- signal string signal identifier pattern