new Slot(eventName, sticky)
Slot declaration
| Name | Type | Description |
|---|---|---|
eventName |
string |
eventID of the events that |
sticky |
boolean |
If true, the event will fire for observers that subscribe even after the event was fired (example, moduleInitialized) |
Methods
-
emit(params)
-
Emit the event with parameters
Name Type Description paramsObject Custom user object to pass to the listeners
-
subscribe(eventName, listener)
-
Subscribe to an event
Name Type Description eventNamestring The name of the event
listenerfunction Function to be called when the event is triggered. This callback should return true to stop propagation.
-
unsubscribe(listener)
-
Unsubscribe from an event
Name Type Description listenerfunction Listener to be removed