An event emitter whose purpose is to be as feature-rich as possible. This is meant to be more of an experiment of pushing the boundaries of what Event Emitters currently do. The mission is as max features, not min file size. Ease of use is also be a goal.
npm install --save loudspeaker
This first version is simply an event emitter. It does what it's supposed to do. It's the first step. Help getting that second step would be appreciated!
- Adding tests of course
- Common interface for cross browser events
- Intercepting all events
- Event statistics
- All the stuff everyone else does
- More...
Loudspeaker.on(event:string, handler:function[, handerThis:object])
To start listening use this with an event
name that you know will be emitted by Loudspeaker (currently dom events
are not supported).
function ([...args]) {}
The handler will call with the emitted arguments applied.
Loudspeaker.off(event:string, handler:function||true:boolean)
To stop listening for a specific handler. Passing in true
instead of a handler will remove all handlers from that
event.
Loudspeaker.emit(event:string, eventArguments:array)
Emits the event for all the handlers that might be listening, sent along with the arguments that should be included in the handler.