Browse Source

doc: document return values of EventEmitter methods

v0.10.6-release
Sam Roberts 12 years ago
committed by Ben Noordhuis
parent
commit
41cbdc5e64
  1. 8
      doc/api/events.markdown

8
doc/api/events.markdown

@ -39,6 +39,8 @@ Adds a listener to the end of the listeners array for the specified event.
console.log('someone connected!');
});
Returns emitter, so calls can be chained.
### emitter.once(event, listener)
Adds a **one time** listener for the event. This listener is
@ -49,6 +51,8 @@ it is removed.
console.log('Ah, we have our first user!');
});
Returns emitter, so calls can be chained.
### emitter.removeListener(event, listener)
Remove a listener from the listener array for the specified event.
@ -61,11 +65,13 @@ Remove a listener from the listener array for the specified event.
// ...
server.removeListener('connection', callback);
Returns emitter, so calls can be chained.
### emitter.removeAllListeners([event])
Removes all listeners, or those of the specified event.
Returns emitter, so calls can be chained.
### emitter.setMaxListeners(n)
@ -89,6 +95,8 @@ Returns an array of listeners for the specified event.
Execute each of the listeners in order with the supplied arguments.
Returns `true` if event had listeners, `false` otherwise.
### Class Method: EventEmitter.listenerCount(emitter, event)

Loading…
Cancel
Save