Package Exports
- extended-emitter
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (extended-emitter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
extended-emitter.js
Everything you expect from require('events').EventEmitter plus:
optional criteria
you can now specify that you only want the event if certain values are set:
emitter.on('my_object_event', {
myObjectId : object.id
}, function(){
//do stuff here
});or
emitter.once('my_object_event', {
myObjectId : object.id
}, function(){
//do stuff here
});
when
and there's also the addition of a when function which can take ready-style arguments
emitter.when([$(document).ready, 'my-init-event', 'my-load-event'], function(){
});Testing
Run the tests at the project root with:
mochaEnjoy,
-Abbey Hawk Sparrow