MyRepo-Ums/node_modules/custom-event
2024-01-19 11:09:11 +01:00
..
test first commit 2024-01-19 11:09:11 +01:00
.npmignore first commit 2024-01-19 11:09:11 +01:00
.travis.yml first commit 2024-01-19 11:09:11 +01:00
History.md first commit 2024-01-19 11:09:11 +01:00
index.js first commit 2024-01-19 11:09:11 +01:00
LICENSE first commit 2024-01-19 11:09:11 +01:00
Makefile first commit 2024-01-19 11:09:11 +01:00
package.json first commit 2024-01-19 11:09:11 +01:00
README.md first commit 2024-01-19 11:09:11 +01:00

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