18 lines
387 B
TypeScript
18 lines
387 B
TypeScript
import { initAppState } from './main';
|
|
|
|
async function initClient() {
|
|
if (import.meta.env.SSR) return;
|
|
await initAppState();
|
|
await import('./style.css');
|
|
const { renderPage } = await import('./lib/router/pageRenderer');
|
|
await renderPage();
|
|
|
|
window.onpopstate = async (e: PopStateEvent) => {
|
|
if (e.state === null) {
|
|
return;
|
|
}
|
|
await renderPage();
|
|
};
|
|
}
|
|
|
|
await initClient(); |