Skip to content

Instantly share code, notes, and snippets.

@dalmaer
Created April 19, 2011 00:24
Show Gist options
  • Save dalmaer/926578 to your computer and use it in GitHub Desktop.
Save dalmaer/926578 to your computer and use it in GitHub Desktop.
// simple
eve.on("*.under.*", f);
eve("mouse.under.floor"); // triggers f
// more subs
eve.on("hit", f1 = function () {
log("I’m hit!");
});
eve.on("hit/face", f2 = function () {
log("Oh, my face!");
});
eve.on("hit/chest", f3 = function () {
log("Oh, my chest!");
});
eve.on("hit/*/leg", f4 = function () {
log("Ouch!");
});
// You can use "." or "/" as delimiter
eve("hit.chest.leg");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment