Nonchalantly Performs Magic

npm

Need private packages and team management tools?Check out npm Orgs. »

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();

install

npm i airship-emitter

Downloadsweekly downloads

2

version

2.0.0

license

UNLICENSED

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability