EventEmitter Class
Base class for objects that dispatches events.
Constructor
EventEmitter
()
Methods
emit
(
EventEmitter
-
event
Emit an event.
Parameters:
-
event
Object-
type
String
-
Returns:
EventEmitter:
The self object, for chainability.
has
(
Boolean
-
type
-
listener
Check if an event listener is added
Parameters:
-
type
String -
listener
Function
Returns:
Boolean:
off
(
EventEmitter
-
type
-
listener
Remove an event listener
Parameters:
-
type
String -
listener
Function
Returns:
EventEmitter:
The self object, for chainability.
on
(
EventEmitter
-
type
-
listener
Add an event listener
Parameters:
-
type
String -
listener
Function
Returns:
EventEmitter:
The self object, for chainability.