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 has been archived by the owner on May 17, 2021. It is now read-only.
Wolfy87 edited this page Nov 5, 2011
·
2 revisions
About
Retrieves and returns the array of listeners for a specified event. Will return an empty array if no listeners where found.
Arguments
EventEmitter.listeners(type);
Stringtype Event type name to return all listeners from
Returns
Array Will return either an array of listeners or an empty array if there are none
Examples
var ee = new EventEmitter();
ee.on('foo', function() {
console.log('bar');
});
var listeners = ee.listeners('foo');
if(listeners) {
// Do stuff with the listeners
}
else {
// Show an error or do something else because there are no listeners
}