Cross-browser `CustomEvent` constructor
Branch: master
Clone or download
Latest commit 725c411 Oct 13, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore add .gitignore file Jan 7, 2015
.travis.yml enable Travis-CI testing Jan 7, 2015
History.md
LICENSE
Makefile Makefile: whitespace fix Jan 7, 2015
README.md initial commit Jan 7, 2015
index.js
package.json Release 1.0.1 Oct 13, 2016

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);