custom-event

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i custom-event

Weekly Downloads

2,931,165

Version

1.0.1

License

MIT

Last publish

Collaborators

  • tootallnate
OSZAR »