Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)