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