Created
May 28, 2020 02:21
-
-
Save ombak/d96797f42f449b268b6be71d3c8ef3aa to your computer and use it in GitHub Desktop.
This file contains 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
// ES5 Event Emitter Example | |
var events = require('events').EventEmitter; | |
var emitter = new events.EventEmitter(); | |
emitter.on('newEvent', function(user){ | |
console.log(user); | |
}); | |
emitter.emit('newEvent', "Sukma Saputra"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment