Created
October 30, 2013 21:40
-
-
Save michaelavila/7240820 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
var events = require('events') | |
var emitter = new events.EventEmitter(); | |
emitter.addListener('hello', sayHello); | |
function doSomething() { | |
emitter.emit('hello'); | |
console.log('This should run last'); | |
} | |
function sayHello() { | |
console.log("Hello!"); | |
} | |
doSomething(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment