Skip to content

Commit

Permalink
These functions have no reason to be async
Browse files Browse the repository at this point in the history
  • Loading branch information
Senryoku committed Nov 2, 2023
1 parent ac95856 commit 93f4c20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ts-lib/src/worker-packed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ export type Message = {
data: string;
};

onmessage = async function (e: { data: Message }) {
self.onmessage = function (e: { data: Message }) {
const { command, id, data } = e.data;
switch (command) {
case "decompress": {
postMessage({ id, data: decompressPacked(data) });
self.postMessage({ id, data: decompressPacked(data) });
break;
}
case "compress": {
postMessage({ id, data: compressPacked(data) });
self.postMessage({ id, data: compressPacked(data) });
break;
}
}
Expand Down
6 changes: 3 additions & 3 deletions ts-lib/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ export type Message = {
data: string;
};

onmessage = async function (e: { data: Message }) {
self.onmessage = function (e: { data: Message }) {
const { command, id, data } = e.data;
switch (command) {
case "decompress": {
postMessage({ id, data: decompress(data) });
self.postMessage({ id, data: decompress(data) });
break;
}
case "compress": {
postMessage({ id, data: compress(data) });
self.postMessage({ id, data: compress(data) });
break;
}
}
Expand Down

0 comments on commit 93f4c20

Please sign in to comment.