I_Jemin

Emitter Practice

Showing 1 changed file with 4 additions and 1 deletions
......@@ -6,6 +6,9 @@ emitter.on('messageLogged', (arg) => {
console.log('Listener called',arg);
});
emitter.emit('messageLogged', {id: 1, url: 'http://' });
emitter.on('logging', (e) => { console.log('Loggin Event',e);});
emitter.emit('messageLogged', {id: 1, url: 'http://' });
// Raise: logging (data: message)
emitter.emit('logging','Jemin');
......