From f1e9cbdadc27fe99c2dbdbb80aeea578ea0a067f Mon Sep 17 00:00:00 2001 From: eric2788 Date: Wed, 10 Jan 2024 22:53:25 +0800 Subject: [PATCH] fixed load wasm url not working --- src/adapters/websocket-hook.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/adapters/websocket-hook.js b/src/adapters/websocket-hook.js index 80aa5bac..8909bf80 100644 --- a/src/adapters/websocket-hook.js +++ b/src/adapters/websocket-hook.js @@ -1,12 +1,11 @@ import { injectFuncAsListener } from "~utils/event" import { sendBLiveMessage } from "~utils/messaging" import wasmUrl from "raw:~assets/brotli-dec.wasm" -import init from 'brotli-dec-wasm/pkg/index' +import init, { decompress as wasmDecompress } from 'brotli-dec-wasm/pkg/index' var decompress = null - -const loadWasm = init(wasmUrl).then(output => { - decompress = output.decompress +const loadWasm = init(wasmUrl).then(_ => { + decompress = wasmDecompress console.info('wasm loaded.') })