I_Jemin

Emitter Practice

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