From 353646ff61911f101402ad9e69529d3ad80ac19d Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Fri, 8 May 2015 14:41:57 -0400 Subject: [PATCH 1/2] doc: Infinity for 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 closes https://github.com/joyent/node/issues/22987 --- doc/api/events.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/events.markdown b/doc/api/events.markdown index b9501632b205be..847144764b3217 100644 --- a/doc/api/events.markdown +++ b/doc/api/events.markdown @@ -92,7 +92,7 @@ Returns emitter, so calls can be chained. By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function -allows that to be increased. Set to zero for unlimited. +allows that to be increased. Set to `Infinity` for unlimited. Returns emitter, so calls can be chained. From 97324b8c99b750c19d011c6588316ac6a146ac6c Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Wed, 9 Sep 2015 09:30:43 -0400 Subject: [PATCH 2/2] document that 0 is acceptable as well, but not preferred --- doc/api/events.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/events.markdown b/doc/api/events.markdown index 847144764b3217..9c02a0380d5b49 100644 --- a/doc/api/events.markdown +++ b/doc/api/events.markdown @@ -92,7 +92,7 @@ Returns emitter, so calls can be chained. By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function -allows that to be increased. Set to `Infinity` for unlimited. +allows that to be increased. Set to `Infinity` (or `0`) for unlimited. Returns emitter, so calls can be chained.