Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2013-05-01 02:24:48 +0400
committerBen Noordhuis <info@bnoordhuis.nl>2013-05-03 03:10:01 +0400
commit41cbdc5e64d090e0708dd2a63d4cd63000019bb1 (patch)
tree2f2e6d0bf0dd844dcbe4b0ecadecc92a2f7ede55 /doc
parent0e21d7b985954f80bdb6842da005fb438e8b9b34 (diff)
doc: document return values of EventEmitter methods
Diffstat (limited to 'doc')
-rw-r--r--doc/api/events.markdown8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/api/events.markdown b/doc/api/events.markdown
index 1338231168a..84d2bc0a3a4 100644
--- a/doc/api/events.markdown
+++ b/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)