Skip to content

Commit 793c76e

Browse files
othiym23indutny
authored andcommitted
docs: add cautionary note to emitter.removeAllListeners
Signed-off-by: Fedor Indutny <fedor@indutny.com>
1 parent 3f3a71e commit 793c76e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

doc/api/events.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ Returns emitter, so calls can be chained.
6969

7070
### emitter.removeAllListeners([event])
7171

72-
Removes all listeners, or those of the specified event.
72+
Removes all listeners, or those of the specified event. It's not a good idea to
73+
remove listeners that were added elsewhere in the code, especially when it's on
74+
an emitter that you didn't create (e.g. sockets or file streams).
7375

7476
Returns emitter, so calls can be chained.
7577

0 commit comments

Comments
 (0)