0.1.1 • Published 9 years ago

vent.js v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

vent

Basic JS events with no dependencies

Build Status Coverage Status

Installation:*

npm install vent.js

Usage:

Include vent.js before your subscriptions

New event subscription:

vent.on('eventName', callback);

Trigger event:

vent.trigger('eventName');

Unsubscribe:

var eventToUnSub = vent.on('example', function() {
  console.log('test');
});
vent.off(eventToUnSub);

Check whether an event has any callbacks to run:

vent.hasEvent('eventName');