Module m.signal
Module to create a signal system where named signals can be created, listened to and triggered
Usage:
Functions
create (signal_id) | Create a signal |
add (cb) | Add a listener to the signal |
remove (cb) | Remove a listener from the signal |
trigger (message) | Trigger the signal |
Functions
- create (signal_id)
-
Create a signal
Parameters:
- signal_id The unique id of the signal
Returns:
-
The created signal
- add (cb)
-
Add a listener to the signal
Parameters:
- cb Function callback or message url (defaults to current url)
- remove (cb)
-
Remove a listener from the signal
Parameters:
- cb Function callback or message url (defaults to current url)
- trigger (message)
-
Trigger the signal
Parameters:
- message Message to pass to listeners