This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
event-target-shim | dependencies | major | ^5.0.1 -> ^6.0.0 |
v6.0.2
This version fixed event-target-shim/es5
and event-target-shim/umd
exported files for working well on IE11.
v6.0.1
v6.0.0
This package has been rewritten with TypeScript.
API has some breaking changes. See Migration Guide for details.
Event
class is availablePreviously, this package had not exported Event
class as prefers using the native Event
class. Since this version, this package exports it.
import { EventTarget, Event } from "event-target-shim";
const target = new EventTarget();
target.dispatchEvent(new Event("foo"));
signal
option on EventTarget.prototype.addEventListener
is availableIt's a new feature that was added to the standard recently: whatwg/dom#919
import { EventTarget, Event } from "event-target-shim";
import { AbortController } from "abort-controller";
const target = new EventTarget();
const ac = new AbortController();
target.addEventListener("foo", listener, { signal: ac.signal });
// Remove the listener
ac.abort();
Since this version, if a listener threw an exception, it causes the uncaughtException
event on Node.js or the error
event on window
. Also, if an operation was ignored silently, it prints warnings with console.warn
.
You can customize this behavior.
import { setErrorHandler, setWarningHandler } from "event-target-shim";
setErrorHandler((error) => {
// Do something.
});
setWarningHandler((warning) => {
// Do something.
});
This MR has been generated by Renovate Bot.