js-eventtarget

Event target abstract class

Usage no npm install needed!

<script type="module">
  import jsEventtarget from 'https://cdn.skypack.dev/js-eventtarget';
</script>

README

publixe-eventtarget

Event target abstract class


import EventTarge from 'publixe-eventtarget';

class Service extends EventTarget {
    check() {
        this.dispatchEvent('check', {abc: 'ABC'});
    };
};

let s = new Service();
let fn1 = (o) => {
    console.log('fn1', o);
};

s.addEventListener('check', fn1);
s.check();