You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
Returns an array of listeners for the specified event.
However, return an array usually indicating return an array reference, and here is different.
Maybe we can consider to modify this part of document, Thanks!
Example code
var EventEmitter = require('events').EventEmitter;
var eventEmitter = new EventEmitter();
var arrListeners = eventEmitter.listeners('test-event');
console.log(arrListeners.length);
eventEmitter.addListener('test-event', function(){
//Do sth.
});
console.log(arrListeners.length); // log 0 because the this array reference is different with current one.
arrListeners = eventEmitter.listeners('test-event');
console.log(arrListeners.length);