Skip to content

Commit 0cfc6d3

Browse files
jasonkarnsjasnell
authored andcommitted
doc: recommend Infinity on emitter.setMaxListeners
Instead of recommending `0` as the magic value to set max listeners to unlimited, recommend `Infinity`. This paves the way for `0` as a magic value eventually being deprecated and finally removed. PR-URL: #2559 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: targos - Michaël Zasso <[email protected]> Reviewed-By: Brendan Ashworth <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent 589287b commit 0cfc6d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/events.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Returns emitter, so calls can be chained.
9292
By default EventEmitters will print a warning if more than 10 listeners are
9393
added for a particular event. This is a useful default which helps finding
9494
memory leaks. Obviously not all Emitters should be limited to 10. This function
95-
allows that to be increased. Set to zero for unlimited.
95+
allows that to be increased. Set to `Infinity` (or `0`) for unlimited.
9696

9797
Returns emitter, so calls can be chained.
9898

0 commit comments

Comments
 (0)