event-target-mixin
1.0.4 • Public • Published event-target-mixin.js
W3C EventTarget mixin for custom objects
Usage
import EventTarget from 'event-target-mixin';
let Car = () => {
EventTarget.call(this);
this.start = () => {
this.dispatchEvent(new Event('started'));
};
};
let car = new Car();
car.addEventListener('started', (event) => {
if (event.type === 'started')
alert('vroom vroom!');
});
car.start();
Build
$ npm install
$ npm run build
License
MIT
forked from ShareIt-project/EventTarget.js
and mrdoob/eventdispatcher.js
see LICENSE file
Links
W3C DOM4 specification
DOM Living Standard specification
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 1.0.4
1
Version History
Package Sidebar
Install
Weekly Downloads