revite/src/main.tsx

22 lines
559 B
TypeScript
Raw Normal View History

2021-07-05 06:23:23 -04:00
import { registerSW } from "virtual:pwa-register";
2021-06-18 14:25:33 -04:00
2021-06-22 09:22:35 -04:00
import "./styles/index.scss";
import { render } from "preact";
2021-07-05 06:23:23 -04:00
import { internalEmit } from "./lib/eventEmitter";
2021-06-22 09:22:35 -04:00
import { App } from "./pages/app";
2021-07-05 06:23:23 -04:00
export const updateSW = registerSW({
2021-07-05 06:25:20 -04:00
onNeedRefresh() {
internalEmit("PWA", "update");
},
onOfflineReady() {
console.info("Ready to work offline.");
// show a ready to work offline to user
},
2021-07-05 06:23:23 -04:00
});
2021-06-18 10:46:30 -04:00
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2021-06-18 10:57:08 -04:00
render(<App />, document.getElementById("app")!);