use channels for comms (#9)

this  refactors the app setup and messaging modules
This commit is contained in:
Akash Shakdwipeea
2025-08-20 21:58:09 +05:30
committed by GitHub
parent ba2d1c064b
commit 3b81926ae1
22 changed files with 981 additions and 900 deletions
+2 -3
View File
@@ -14,8 +14,8 @@
height: 100%;
}
canvas {
width: 90%;
height: 300px;
width: 100%;
height: 100vh;
background-color: yellowgreen;
}
</style>
@@ -26,7 +26,6 @@
<ul>
</ul>
</nav>
<h1 class="title">Enjoy WebGPU + WASM + Webpack with 🍰☕</h1>
</header>
<main>
<section>
+7 -4
View File
@@ -1,10 +1,13 @@
import wbg_init, { main, App } from "../pkg/wasm-index.js";
import wbg_init, { main } from "../pkg/wasm-index.js";
const start = async () => {
await wbg_init();
main();
const app = new App();
};
start();
// Wait for DOM to be ready before starting
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', start);
} else {
start();
}