I_Jemin

Event Argument

Showing 1 changed file with 9 additions and 2 deletions
const log = require('./logger')
const EventEmitter = require('events');
const emitter = new EventEmitter();
// Register a listener
emitter.on('messageLogged', function(arg) { // e, eventArg
console.log('Listener called',arg);
});
emitter.emit('messageLogged', {id: 1, url: 'http://' });
log('message');
\ No newline at end of file
......