Open deoxxa opened 11 years ago
Certain events require more advanced flow control than "call a bunch of listeners" (see https://github.com/deoxxa/jsmc/pull/10 for an example).
I think we need an event library that implements something similar to stopPropagation for this, so the following becomes possible:
player.on("chat", function(message, ev) { if (message.length > 0 && message[0] === "/") { player.emit("command", message.substr(1)); ev.stopPropagation(); } });
Certain events require more advanced flow control than "call a bunch of listeners" (see https://github.com/deoxxa/jsmc/pull/10 for an example).
I think we need an event library that implements something similar to stopPropagation for this, so the following becomes possible: