Look ma! hot reload! (#16)

This commit is contained in:
Akash Shakdwipeea
2025-10-24 19:44:06 +05:30
committed by GitHub
parent 8addf60eea
commit 2a49f07d68
9 changed files with 126 additions and 37 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
import wbg_init, { main } from "../level-editor/pkg/wasm-index.js";
import wbg_init, { main } from "../level-editor/pkg/level_editor.js";
const start = async () => {
await wbg_init();
@@ -6,8 +6,8 @@ const start = async () => {
};
// Wait for DOM to be ready before starting
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', start);
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", start);
} else {
start();
}