JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9305
  • Score
    100M100P100Q130108F
  • License MIT

An emitter with expanded utility, UMD with dependencies for node and the browser

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:

mocha

Enjoy,

-Abbey Hawk Sparrow