Skip to content

Instantly share code, notes, and snippets.

@ondrek
Created March 24, 2014 08:59
Show Gist options
  • Save ondrek/9736687 to your computer and use it in GitHub Desktop.
Save ondrek/9736687 to your computer and use it in GitHub Desktop.
Test
"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