mysticatea / event-target-shim

An implementation of WHATWG EventTarget interface, plus few extensions.
MIT License
124 stars 26 forks source link

Support for CustomEvent #35

Open oles opened 3 years ago

oles commented 3 years ago

As a curiosity, I'd like to experiment with the native variant of an event emitter, as described in

https://medium.com/@zandaqo/eventtarget-the-future-of-javascript-event-systems-205ae32f5e6b and https://css-tricks.com/lets-create-a-lightweight-native-event-bus-in-javascript/

It works in all modern browsers today and Deno - but not Node!

Running new CustomEvent() results in ReferenceError: CustomEvent is not defined in the latest version (currently 15.5.1)

I'm not sure if it's in scope for this project to support it, or if a custom-event-shim is more fitting :thinking:

mysticatea commented 3 years ago

Thank you for your proposition.

Indeed, sounds good that this package provides CustomEvent as well.