Answers for "event module"

0

event module

const EventEmitter = require('events');
const myEE = new EventEmitter();
myEE.on('foo', () => {});
myEE.on('bar', () => {});

const sym = Symbol('symbol');
myEE.on(sym, () => {});

console.log(myEE.eventNames());
// Prints: [ 'foo', 'bar', Symbol(symbol) ]
Posted by: Guest on September-19-2021

Code answers related to "event module"

Code answers related to "Javascript"

Browse Popular Code Answers by Language