Skip to content

Commit

Permalink
perf: remove add/remove event polyfills\n\nWe don't polyfill these br…
Browse files Browse the repository at this point in the history
…owsers using core-js (i.e. it most likely doesn't work anyway) and barely anyone is using them nowadays. (#2039)
  • Loading branch information
Thomaash authored Nov 2, 2023
1 parent 0a229fb commit f1b7870
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/network/modules/Canvas.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { onRelease, onTouch } from "../../hammerUtil";

import {
Hammer,
addEventListener,
removeEventListener,
selectiveDeepExtend,
} from "vis-util/esnext";
import { Hammer, selectiveDeepExtend } from "vis-util/esnext";

/**
* Create the main frame for the Network.
Expand Down Expand Up @@ -98,9 +93,9 @@ class Canvas {

// Automatically adapt to changing size of the browser.
const resizeFunction = this._onResize.bind(this);
addEventListener(window, "resize", resizeFunction);
window.addEventListener("resize", resizeFunction);
this._cleanupCallbacks.push(() => {
removeEventListener(window, "resize", resizeFunction);
window.removeEventListener("resize", resizeFunction);
});
}
}
Expand Down

0 comments on commit f1b7870

Please sign in to comment.