React client app #5

Merged
CrispyBaguette merged 18 commits from react-client-app into master 2021-12-12 17:42:16 +00:00
Showing only changes of commit 4b097a0d15 - Show all commits

View File

@ -2,8 +2,11 @@ class Ditherer {
async dither(image: Uint8ClampedArray): Promise<Uint8ClampedArray> { async dither(image: Uint8ClampedArray): Promise<Uint8ClampedArray> {
const worker: any = await wasmWorker("/main.wasm"); const worker: any = await wasmWorker("/main.wasm");
let output: Uint8ClampedArray; let output: Uint8ClampedArray;
try {
output = await worker.dither(image); output = await worker.dither(image);
} finally {
worker.terminate(); worker.terminate();
}
return output; return output;
} }
} }