tree: aa2874f178c76fd36c81f41a63a4399c7739c0d4 [path history] [tgz]
  1. test/
  2. .npmignore
  3. .travis.yml
  4. History.md
  5. index.js
  6. LICENSE
  7. Makefile
  8. package.json
  9. 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);