use channels for comms (#9)
this refactors the app setup and messaging modules
This commit is contained in:
+2
-3
@@ -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
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user