instance method EventEmitter#addListener
EventEmitter#addListener(eventName, listener) → this
-
eventName
(String
) – The name of the event that needs to be emitted in order forlistener
to be invoked. -
listener
(Function
) – Thefunction
to call wheneventName
is fired. The arguments to the function are passed fromEventEmitter#emit
.
Adds a listener function
for the specified event name. If eventName
is fired using EventEmitter#emit
, then listener
will be invoked,
with the EventEmitter
instance as this
. Any number of listeners
may be attached to a single eventName
.