Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/awcross/customevent
CustomEvent ponyfill
https://github.com/awcross/customevent
customevent event ponyfill
Last synced: about 12 hours ago
JSON representation
CustomEvent ponyfill
- Host: GitHub
- URL: https://github.com/awcross/customevent
- Owner: awcross
- License: mit
- Created: 2016-07-23T02:40:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-14T23:47:46.000Z (almost 6 years ago)
- Last Synced: 2024-11-12T20:02:01.573Z (7 days ago)
- Topics: customevent, event, ponyfill
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# customevent [![Build Status](https://travis-ci.org/awcross/customevent.svg?branch=master)](https://travis-ci.org/awcross/customevent)
> [Ponyfill](https://ponyfill.com) for [`CustomEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent)
## Install
```
$ npm install --save customevent
```## Usage
```js
const customEvent = require('customevent');const event = new customEvent('click', {
cancelable: true,
bubbles: false,
detail: {
foo: 'bar'
}
});
```## API
### customEvent(typeArg, [customEventInit])
Creates a custom event and returns an event
#### typeArg
Type: `string`
A [DOMString](https://developer.mozilla.org/en-US/docs/Web/API/DOMString) representing the name of the event.
#### customEventInit (optional)
Type: `object`
## License
MIT © [Alex Cross](https://alexcross.io)