Last active
July 21, 2021 15:54
-
-
Save deepal/a0bc5be26598ff17cae79b76fe4e3169 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EventEmitter = require('events'); | |
const myEmitter = new EventEmitter(); | |
myEmitter.on('myevent', () => console.log('handler1: myevent was fired!')); | |
myEmitter.on('myevent', () => console.log('handler2: myevent was fired!')); | |
myEmitter.on('myevent', () => console.log('handler3: myevent was fired!')); | |
myEmitter.emit('myevent'); | |
console.log('I am the last log line'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment