Created
March 24, 2014 08:59
-
-
Save ondrek/9736687 to your computer and use it in GitHub Desktop.
Test
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
"use strict"; | |
var Boilerplate = function() { | |
require("events").EventEmitter.call(this); | |
this.on("synch", function(){ | |
console.log("synch passed"); | |
}); | |
this.on("asynch", function(){ | |
console.log("asynch passed"); | |
}); | |
this.helloWorld(); | |
}; | |
require("util").inherits(Boilerplate, require("events").EventEmitter); | |
Boilerplate.prototype.helloWorld = function(){ | |
this.emit("synch"); | |
setTimeout((function(){ | |
this.emit("asynch"); | |
}).bind(this), 1); | |
}; | |
new Boilerplate(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment