not baad
This commit is contained in:
parent
4a8aff90b2
commit
6cef9a3abe
11 changed files with 1184 additions and 235 deletions
11
mapPatchWorker.js
Normal file
11
mapPatchWorker.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { generatePatch } from "./mapPatch.js";
|
||||
|
||||
self.onmessage = (event) => {
|
||||
const { id, world, rect, options } = event.data || {};
|
||||
try {
|
||||
const result = generatePatch(world, rect, options || {});
|
||||
self.postMessage({ id, ok: true, world, result });
|
||||
} catch (error) {
|
||||
self.postMessage({ id, ok: false, error: error?.message || String(error), stack: error?.stack || "" });
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue