From bdc9cc92f61cb27be8f4fe7e312c8ed87ad80e3a Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Thu, 10 Sep 2020 10:20:28 -0400 Subject: [PATCH] await Decoder.decode in worker --- src/decoder.worker.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/decoder.worker.js b/src/decoder.worker.js index 5529d720..9c09beaf 100644 --- a/src/decoder.worker.js +++ b/src/decoder.worker.js @@ -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);