On that note, perhaps take inspiration from the "readline" module in node-core: https://github.com/joyent/node/blob/a811a4a13042a4b3ba019fbe1221f4c83b02a699/lib/readline.js#L776-804
It checks for listeners.length on the 'data' event, and if nobody's listening then it unregisters the 'data' handler completely. On Thu, May 10, 2012 at 7:07 PM, mscdex <[email protected]> wrote: > I'm curious as to if just checking `foo.listeners('event').length > 0` > is good enough for your application? >
