custom-event

Cross-browser `CustomEvent` constructor

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
custom-event
9631.0.16 years ago8 years agoMinified + gzip package size for custom-event in KB

Readme

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