Skip to content

Commit

Permalink
await Decoder.decode in worker
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Sep 10, 2020
1 parent a07d855 commit bdc9cc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/decoder.worker.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { expose, Transfer } from 'threads/worker';
import { getDecoder } from './compression';

function decode(fileDirectory, buffer) {
async function decode(fileDirectory, buffer) {
const decoder = getDecoder(fileDirectory);
return Transfer(decoder.decode(fileDirectory, buffer));
const decoded = await decoder.decode(fileDirectory, buffer);
return Transfer(decoded);
}

expose(decode);

0 comments on commit bdc9cc9

Please sign in to comment.