We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db52004 commit 53aab29Copy full SHA for 53aab29
doc/api/events.md
@@ -598,9 +598,13 @@ logFnWrapper.listener();
598
// logs "log once" to the console and removes the listener
599
logFnWrapper();
600
601
-// will return an empty array
+emitter.on('log', () => console.log('log persistently'));
602
+// will return a new Array with a single function bound by `on` above
603
const newListeners = emitter.rawListeners('log');
-assert.strictEqual(newListeners.length, 0);
604
+
605
+// logs "log persistently" twice
606
+newListeners[0]();
607
+emitter.emit('log');
608
```
609
610
[`--trace-warnings`]: cli.html#cli_trace_warnings
0 commit comments