Setup example worker

This commit is contained in:
Schluffe committed 2026-09-27 18:09:53 +02:00
1 parent a647cd5184
commit d57c58a3bd
4 files changed
+24 -2

No files matched your search

+9
View File
@@ -85,3 +85,12 @@ function animate(timestamp: number): void {
animate(delta);
})();
const worker = new Worker(new URL("./worker.ts", import.meta.url), {
type: "module",
});
worker.onmessage = (event) => {
console.log(event.data);
};
worker.postMessage("foo");