mirror of
https://github.com/codedread/bitjs
synced 2025-10-04 18:19:15 +02:00
Fix JS error in WebWorker wrapper
This commit is contained in:
parent
6d7d4abac7
commit
5bf583c617
1 changed files with 3 additions and 1 deletions
|
@ -15,9 +15,11 @@
|
|||
/** @type {MessagePort} */
|
||||
let implPort;
|
||||
|
||||
let module;
|
||||
|
||||
onmessage = async (evt) => {
|
||||
if (evt.data.implSrc) {
|
||||
const module = await import(evt.data.implSrc);
|
||||
module = await import(evt.data.implSrc);
|
||||
module.connect(evt.ports[0]);
|
||||
} else if (evt.data.disconnect) {
|
||||
module.disconnect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue