Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interruptible Event Layer #11

Open
deoxxa opened this issue Nov 11, 2012 · 0 comments
Open

Interruptible Event Layer #11

deoxxa opened this issue Nov 11, 2012 · 0 comments

Comments

@deoxxa
Copy link
Owner

deoxxa commented Nov 11, 2012

Certain events require more advanced flow control than "call a bunch of listeners" (see #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();
  }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant