Class: Slot

events. Slot

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
params Object

Custom user object to pass to the listeners

subscribe(eventName, listener)

Subscribe to an event

Name Type Description
eventName string

The name of the event

listener function

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
listener function

Listener to be removed