This commit is contained in:
2025-10-29 21:14:44 -07:00
parent 667624d0ca
commit 965253386a
13 changed files with 146 additions and 58 deletions

View File

@@ -22,7 +22,14 @@ async function initWasm(): Promise<void> {
self.onmessage = async (event) => {
const { type, script } = event.data;
if (type === "run") {
if (type === "init") {
try {
await initWasm();
self.postMessage({ type: "ready" });
} catch (error) {
self.postMessage({ type: "error", error: String(error) });
}
} else if (type === "run") {
try {
await initWasm();