eventEmitter.on('*', function() {
console.log('got event type %s and args %j', this.event, arguments);
});
Another way would be to overwrite EventEmitter.prototype.emit
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
Question is, why?
The core EventEmitter-class is pure javascript, nothing fancy, just
the very basics. It is sufficient for almost all situations. The more
you add to this basics, the more overhead/inefficiency you'll get in
return.
If it is really not sufficient, a simple 'npm install eventemitter2'
or dependency to eventemitter2 in package.json , then
require('eventemitter2') - and hooray, and you can use it.
But if I would need only what you described, I would overwrite 'emit'
of the EventEmitter. Its not that hard, EventEmitter of nodes
events.js is pure JS.
No offense.
I'm interested here in collecting opinions and also from the core team.
No dia 08/04/2012, às 20:58, Oliver Leics <oliver...@gmail.com> escreveu:
> I seriously wonder if you read what I wrote.
>
> No offense.
>
EventEmitter2 has .onAny()
No.
caevents - 'Catch all events' event emitter for node.js
npm install caevents
Repository:
https://github.com/oleics/node-caevents
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
--
-Pedro