Skip to content

Instantly share code, notes, and snippets.

@thejefflarson
Created October 7, 2010 15:39
Show Gist options
  • Select an option

  • Save thejefflarson/615306 to your computer and use it in GitHub Desktop.

Select an option

Save thejefflarson/615306 to your computer and use it in GitHub Desktop.
var events = {
e : {},
register : function(key, fn) {
this.e[key] = fn;
},
trigger : function(key){
this.e[key]();
}
}
events.register("error", function(){
throw "new error";
});
events.trigger("error");
console.log("no message out");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment