You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
532 B
TypeScript
25 lines
532 B
TypeScript
import "preact/debug";
|
|
import { h, render } from "preact";
|
|
|
|
import { App } from "./components/App/App.ts";
|
|
|
|
import {
|
|
LOCAL_STORAGE_KEY,
|
|
defaultAppState,
|
|
loadStateFromLocalStorage,
|
|
} from "./state/store.ts";
|
|
|
|
const init = () => {
|
|
const state = loadStateFromLocalStorage();
|
|
// const state = defaultAppState;
|
|
const app = h(App, state);
|
|
|
|
render(app, document.body);
|
|
};
|
|
|
|
document.addEventListener("DOMContentLoaded", init);
|
|
(window as any)["resetApp"] = () => {
|
|
localStorage.removeItem(LOCAL_STORAGE_KEY);
|
|
location.reload();
|
|
};
|