tree: e986a187eb734ab5979dbce7539cdedd880e9a98 [path history] [tgz]
  1. .npmignore
  2. .travis.yml
  3. History.md
  4. index.js
  5. LICENSE
  6. Makefile
  7. package.json
  8. README.md
node_modules/custom-event/README.md

custom-event

Cross-browser CustomEvent constructor

Sauce Test Status

Build Status

https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent.CustomEvent

Installation

$ npm install custom-event

Example

var CustomEvent = require('custom-event');

// add an appropriate event listener
target.addEventListener('cat', function(e) { process(e.detail) });

// create and dispatch the event
var event = new CustomEvent('cat', {
  detail: {
    hazcheeseburger: true
  }
});
target.dispatchEvent(event);