Rest
...args: Parameters<TFunc>Optional
[captureBy default EventEmitter
s will print a warning if more than 10
listeners are
added for a particular event. This is a useful default that helps finding
memory leaks. The emitter.setMaxListeners()
method allows the limit to be
modified for this specific EventEmitter
instance. The value can be set toInfinity
(or 0
) to indicate an unlimited number of listeners.
Returns a reference to the EventEmitter
, so that calls can be chained.
v0.3.5
A typed interface of EventEmitter.
Use the
&
operator to combine multiple event/function pairs into a single event emitter. The result needs to be a type and not an interface because of https://github.com/microsoft/TypeScript/issues/16936.Use the createGenericEventEmitterClass function to generate an event emitter class with the correct typings in case EventEmitter needs to be extended.