Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

custom-event

webmodules12mMIT1.0.1

Cross-browser CustomEvent constructor

dom, browser, event, custom, customevent, constructor

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

changelog

1.0.1 / 2016-10-13

  • add MIT license file (fix #2)
  • isomorphic support (#3, @nescalante)
  • test: remove bad assert() call

1.0.0 / 2015-01-07

  • Makefile: whitespace fix
  • enable Travis-CI testing
  • add .gitignore file
  • test: add test cases
  • initial commit