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

[Feature Request] All unhandled events #72

Closed
rdrey opened this issue Nov 5, 2012 · 3 comments
Closed

[Feature Request] All unhandled events #72

rdrey opened this issue Nov 5, 2012 · 3 comments

Comments

@rdrey
Copy link

rdrey commented Nov 5, 2012

Hey Paolo

I'd love to do a kind of pipe to another EventEmitter for all events that haven't been handled by my component.

The API I have in mind is the following:

server.on('foo.*', function(value1, value2) {
  console.log(this.event, value1, value2);
}).on('bar.baz', function(value1, value2) {
  console.log(this.event, value1, value2);
}).unhandled(function(value1, value2) {
  // Any event not in 'foo.*' or 'bar.baz':
  console.log(this.event, value1, value2); 
});

unhandled could be onOther or whatever else fits into the EventEmitter style.

What do you think, could this be low-level enough to be useful for everyone else?

@xingrz
Copy link

xingrz commented Feb 8, 2013

Need this!

I'm trying to pass all events to front-end via socket.io.

@heapwolf
Copy link
Member

ah! ok, so this is great, im considering rewriting this lib to handle plugins, where the entire wild card system would be plugged in, i've recently had some performance improvement ideas.

@bananushka bananushka mentioned this issue Sep 4, 2013
@RangerMauve
Copy link
Contributor

You can listen on "all" events using onAny, should be easy enough to make a wrapper or utility to enable this functionality. Also, adding state to the result of on doesn't seem like it'd be good for performance.

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

4 participants