Class
EventEmitter<T>
On this page
Class that can handle event dispatching. Users can register
event handlers for certain events and when the emit() function
is called, this class will take care of invoking all of the event
handlers that were registered for events of that type.
Type Parameters
Hierarchy (View Summary)
- EventEmitter
Constructors
constructor
new EventEmitter<T extends Record<string, any[]>>(): EventEmitter<T>Type Parameters
Returns EventEmitter<T>
Methods
emit
Fires the event, calling all registered listeners with the provided arguments.
Type Parameters
Parameters
Returns void
off
Removes a listener for the event.
Type Parameters
Parameters
Returns void