You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
3 years ago | |
---|---|---|
.. | ||
test | 3 years ago | |
.npmignore | 3 years ago | |
.travis.yml | 3 years ago | |
History.md | 3 years ago | |
LICENSE | 3 years ago | |
Makefile | 3 years ago | |
README.md | 3 years ago | |
index.js | 3 years ago | |
package.json | 3 years ago |
README.md
custom-event
Cross-browser CustomEvent
constructor
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);