MCPcopy Index your code
hub / github.com/webpack/mini-css-extract-plugin / makeButton

Function makeButton

test/manual/src/index.js:47–59  ·  view source on GitHub ↗
(className, fn, shouldDisable = true)

Source from the content-addressed store, hash-verified

45};
46
47const makeButton = (className, fn, shouldDisable = true) => {
48 const button = document.querySelector(className);
49 button.addEventListener("click", () => {
50 if (shouldDisable) {
51 button.disabled = true;
52 }
53 fn()
54 .then(() => {
55 button.disabled = false;
56 })
57 .catch(handleError);
58 });
59};
60
61makeButton(".lazy-button", () => import("./lazy"));
62makeButton(".lazy-button2", () => import("./lazy2.css"));

Callers 1

index.jsFile · 0.85

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…