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

Support type-less listener registration. #4

Open
nbubna opened this issue Apr 22, 2014 · 0 comments
Open

Support type-less listener registration. #4

nbubna opened this issue Apr 22, 2014 · 0 comments

Comments

@nbubna
Copy link
Member

nbubna commented Apr 22, 2014

For cross-cutting concerns like logging and debugging, it would be convenient to support registering listeners by category (or tag or whatever) alone, without limiting by type.

Eventi.on('group:', function(e) {
  console.log('Group event: '+e.type, e);
});

This will require a) registering the handler for all known types on the target and b) watching all future listener registrations on the target for new types.

This will have the very obvious limitation that it will be entirely unable to intercept event types not otherwise being listened for by Eventi. Thus, we should never allow/imply support for an entirely empty listener definition (i.e. a "catch-all" listener).

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