airship-emitter

2.0.0 • Public • Published

Airship-Emitter

This is a simple event emitter implementation.

Installation:

Node.js, browserify, and webpack users can install via npm:
npm install --save-dev airship-emitter

Available at github and npm repository.

Testing:

npm test

Documentation:

JSDoc documentation is housed in the doc folder.

Usage:

// Create an event emitter

var EventEmitter = require('airship-emitter');

var emitter = new EventEmitter();

var fxn = function(element) {
   // Do something awesome...
}

// Adds a handler that can be invoked more than once

emitter.add('onclick', fxn);

// Adds a handler that is invoked only once

emitter.once('onchange', fxn);

// Invokes all handlers for the event passing them all other arguments

emitter.emit('onclick', args);

// Removes/clears the handlers

emitter.remove('onclick', fxn);
emitter.clear();

Dependents (0)

Package Sidebar

Install

npm i airship-emitter

Weekly Downloads

3

Version

2.0.0

License

UNLICENSED

Last publish

Collaborators

  • jesselylemull