Record mapping event names to argument tuples
Record mapping event names to argument tuples
Registers a one-time listener for the specified event.
The listener is automatically removed after the first invocation.
Event name
This emitter for chaining
Emits an event, invoking all registered listeners with the provided arguments.
If the event is "error" and no listeners are registered, the first argument (the error)
will be thrown.
Event name
true if any listeners were invoked, false otherwise
Removes all listeners for the specified event, or all listeners if no event is provided.
Event name
Optionalevent: KOptional event name to clear listeners for
This emitter for chaining
Returns the number of listeners registered for the specified event.
Event name
The event to count listeners for
The number of registered listeners
Generic event emitter with typed events and methods similar to Node.js EventEmitter.
Example