From 793c76e5c65031009525fcb6e5e4af78c28d1c4f Mon Sep 17 00:00:00 2001 From: Forrest L Norvell Date: Mon, 28 Apr 2014 12:38:06 -0700 Subject: [PATCH] docs: add cautionary note to emitter.removeAllListeners Signed-off-by: Fedor Indutny --- doc/api/events.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/events.markdown b/doc/api/events.markdown index 77d0418e217..07c5b0e2b21 100644 --- a/doc/api/events.markdown +++ b/doc/api/events.markdown @@ -69,7 +69,9 @@ Returns emitter, so calls can be chained. ### emitter.removeAllListeners([event]) -Removes all listeners, or those of the specified event. +Removes all listeners, or those of the specified event. It's not a good idea to +remove listeners that were added elsewhere in the code, especially when it's on +an emitter that you didn't create (e.g. sockets or file streams). Returns emitter, so calls can be chained.