Private
Readonly
listenersProtected
onPrivate
registerRemoves all listeners, or those of the specified event.
It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).
Returns a reference to the EventEmitter, so that calls can be chained.
Optional
event: Kevent type to remove listeners for if not specified all listeners are removed
Removes the specified listener from the listener array for the event named event.
removeListener()
will remove, at most, one instance of a listener from the listener array.
If any single listener has been added multiple times to the listener array for the specified eventName,
then removeListener()
must be called multiple times to remove each instance.
event type to remove listener from
listener to remove
An event emitter that has better support async methods giving the emitter the option to execute event handlers async in sequence instead of in parallel.
All handlers can be removed using
If async event handlers throw an error when
hideExceptions
is set tofalse
the emitter will receive the error.Example