-
Notifications
You must be signed in to change notification settings - Fork 0
EventEmitter.hasListener
Dragiyski edited this page Mar 28, 2015
·
1 revision
Check if the object has any listener or specified listener function.
emitter.hasListener()
emitter.hasListener(event);
emitter.hasListener(event, listener);| Argument | Type | Required | Description |
|---|---|---|---|
| event | string | The name of the event. | |
| listener | function | A function. |
In the first form, the method returns true if the event emitter has any events at all.
In the second form, the method returns true if the event emitter has listeners for specified event.
In the third form, the method returns true the event emitter has specified listener for specified event.
In any other case method returns false.