playground/src/index.tsx   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 0

Size

Lines of Code 35
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 23
mnd 2
bc 2
fnc 0
dl 0
loc 35
rs 10
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
1
import "assets/styles/styles.output.css";
2
import theme from "theme.config.json";
3
4
if ("serviceWorker" in navigator && process.env.NODE_ENV === "production") {
5
  navigator.serviceWorker
6
    .register("./serviceWorker.js", { scope: "/modular-ui/" })
7
    .then(
8
      function () {
9
        console.log("Service worker registration succeeded");
10
      },
11
      /*catch*/ function () {
12
        console.log("Service worker registration failed");
13
      }
14
    );
15
} else {
16
  console.log("Service workers are not supported.");
17
}
18
19
import("@cianciarusocataldo/modular").then(({ initApplication }) => {
20
  import("engine.config").then(({ default: engine }) => {
21
    initApplication({
22
      engine,
23
      theme,
24
      onComplete: (App) => {
25
        import("react-dom").then(({ render }) => {
26
          render(App, document.getElementById("root"), () => {
27
            let Preloader = document.getElementById("preloader");
28
            if (Preloader) Preloader.style.visibility = "hidden";
29
          });
30
        });
31
      },
32
    });
33
  });
34
});
35