add day 26

This commit is contained in:
Zoe
2022-10-18 23:06:15 -05:00
parent ed55d7c9a2
commit e017cbf418
76 changed files with 19362 additions and 0 deletions

26
day26/src/entry-client.ts Normal file
View File

@@ -0,0 +1,26 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { appState, isSSR } from './main';
async function initClient() {
if (import.meta.env.SSR) return;
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();
};
}
// async function initSSR() {
// const { hydratePage } = await import('./lib/router/hydrationManager');
// await hydratePage();
// }
if (!import.meta.env.SSR) {
if (!isSSR()) initClient();
}