TeaWeb/web/app/legacy/audio-lib/worker/async_require.js

13 lines
456 B
JavaScript
Raw Normal View History

2020-09-01 14:16:43 +02:00
/*
* This is more a hack than any thing else.
* TypeScript can't keep the async import statements, but we require it to initialize the wasm object...
*/
module.exports = {
getAudioLibraryInstance() {
2020-09-01 14:39:35 +02:00
return import("tc-backend/audio-lib/index_bg.wasm").then(wasm => {
return import("tc-backend/audio-lib/index").then(pkg => {
2020-09-01 14:16:43 +02:00
return Object.assign(pkg, { memory: wasm.memory });
});
});
}
};