-
Notifications
You must be signed in to change notification settings - Fork 5
signal.um
Marek Maskarinec edited this page Oct 9, 2022
·
2 revisions
A module for importless communication between modules. A signal is an array
of callbacks with a name.
type Any* = interface{}
type Callback* = fn(ctx: Any)
type Signal* = []Callback
fn register*(name: str, callback: Callback) {
Registers a callback to a signal. There is no need to explicitely create signals.
fn emit*(name: str, ctx: Any) {
Calls all callbacks associated with the passed name.