Map of registered event listeners with this instance.
Returns a symbol that can be used to register an omni-listener.
Emit an event to all event listeners register for that specific event and omni-listeners (listeners registered
wising *
as the event type).
The event to emit, cannot be *
Parameters to pass to the callback functions registered for this event
Unregister an event listener callback.
The event to unregister from
Callback function to remove
Register an event listener callback for the specified event.
NOTE: Pass *
as the event type to listen to all event emitted by this instance.
The event to listen for
Called when the event is emitted by this instance
Mixin method that holds the EventEmitter implementation, this function is exposed through EventEmitter.mixin
.
The parent class into which the EventEmitter implementation will be mixed in.
Generated using TypeDoc
Simple event emitter class.
Supports "omni-listeners" through its
omniEvent
static property. An omni-listener is added/removed as any other listener but it will be triggered with ANY event rather than with a specific one.Events can be strings or symbols. Internally, uses Map and Set instances to deal with events and listeners so in theory anything that can be used as a Map key can be used as an event, only strings and symbols are guaranteed to work however.