chore: use singleton loader to prevent duplicated wasm request

This commit is contained in:
鲁树人
2023-05-10 23:16:12 +01:00
parent fc2238ff39
commit 24a68fcf59
3 changed files with 7 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
import { LibParakeetInit, BlobSink, createArrayBufferReader } from '@jixun/libparakeet';
import { loadLibParakeet, BlobSink, createArrayBufferReader } from '@jixun/libparakeet';
function testWasm() {
LibParakeetInit().then(async (mod) => {
loadLibParakeet().then(async (mod) => {
const data = new Uint8Array(0x2000);
for (let i = 0; i < data.byteLength; i++) {
data[i] = i & 0xff;