You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding a polyfill for EventTarget constructor, an EventEmitter for Javascript objects (e.g. for CustomElements or every other object), as a counterpart to DOM events.
What
Adding a polyfill for
EventTarget
constructor, an EventEmitter for Javascript objects (e.g. for CustomElements or every other object), as a counterpart to DOM events.Details
I stumbled upon EventTarget while reading https://medium.com/@zandaqo/eventtarget-the-future-of-javascript-event-systems-205ae32f5e6b.
It's not supported in IE and Edge, as can be seen here https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/EventTarget#Browser_compatibility.
Additional information
There is already a polyfill available at https://developer.mozilla.org/en-US/docs/Web/API/EventTarget#Simple_implementation_of_EventTarget and a copy of that as a npm module https://github.com/mattkrick/event-target-polyfill, https://www.npmjs.com/package/@mattkrick/event-target-polyfill.
The text was updated successfully, but these errors were encountered: