diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-02-14 00:48:11 -0800 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-03-01 17:36:47 -0800 |
commit | 75305f3babd9e927e92b0d9b70d8bb026492ebd0 (patch) | |
tree | ad953b7593675e5241f47810b83cafaab28fe576 /doc | |
parent | 7707acd6efd40b15f9ee1190d75176d9d3639c0e (diff) | |
download | android-node-v8-75305f3babd9e927e92b0d9b70d8bb026492ebd0.tar.gz android-node-v8-75305f3babd9e927e92b0d9b70d8bb026492ebd0.tar.bz2 android-node-v8-75305f3babd9e927e92b0d9b70d8bb026492ebd0.zip |
events: add check for listeners length
Ability to return just the length of listeners for a given type, using
EventEmitter.listenerCount(emitter, event). This will be a lot cheaper
than creating a copy of the listeners array just to check its length.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/events.markdown | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/api/events.markdown b/doc/api/events.markdown index 7998684e73..10b9ed0441 100644 --- a/doc/api/events.markdown +++ b/doc/api/events.markdown @@ -87,6 +87,12 @@ Returns an array of listeners for the specified event. Execute each of the listeners in order with the supplied arguments. + +### Class Method: EventEmitter.listenerCount(emitter, event) + +Return the number of listeners for a given event. + + ### Event: 'newListener' * `event` {String} The event name |