jQuery Events
jqevents is an event emitter based on jquery events system
Installation
$ npm install jqevents
Features
- bind, emit and release multiple events at a time
- Is a global emitter by default and will operate through the process
- Additional emitters can be created using
jqevents.create();
- Uses jquery type namespaces for unbinding and emitting
methods
create
creates an non-global event emitter
Events
- No new events outside of the internal EventEmitter
Usage
Initiate vitals and add processes
var globalEmitter = ;var nonGlobalemitter = ;
Adding events
emitter;emitter;emitter;emitter;emitter;emitter;emitter;emitter;
Removing events
emitter; //removes handleremitter; //removes all events on oneemitter; //removes all events on one with namespace nsemitter; //removes all events with ns namespaceemitter; //multiple via spaceemitter; //multiple via arrayemitter;emitter;
Triggering events
emitter; //calls all handlersemitter; //calls only the handlers with ns as a namespaceemitter; //call multiple namespaces under an event
Examples
Getting the event & namespaces that emitted the event
emitter; emitter;
Working with Namespaces
//will trigger on emit('fired');emitter; //will trigger on emit('fired') and emit('fired.one');emitter; //will trigger on emit('fired'), emit('fired.one') and emit('fired.two')emitter;
Running tests
$ npm install
$ npm test
License
(The MIT License)