Skip to content

sfrieson/loudspeaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loudspeaker

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.

Getting Started

npm install --save loudspeaker

Version 1.0.0

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!

Future Version Ideas

  • Adding tests of course
  • Common interface for cross browser events
  • Intercepting all events
  • Event statistics
  • All the stuff everyone else does
  • More...

Documentation

Loudspeaker#on

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).

Handler

function ([...args]) {}

The handler will call with the emitted arguments applied.

Loudspeaker#off

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

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.

About

A (soon to be) feature rich event emitter.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published