Skip to main content
Version: 21.3.8

EventEmitter.addListener() method

Warning: This API is now obsolete.

please use EventEmitter.on() instead.

Add an event listener.

Signature:

class EventEmitter {
addListener<Key extends keyof EventsWithWildcard<Events>>(
type: Key,
handler: Handler<EventsWithWildcard<Events>[Key]>
): this;
}

Parameters

ParameterTypeDescription
typeKey
handlerHandler<EventsWithWildcard<Events>[Key]>

Returns:

this