fix: if we are in a webworker, automatically setup the handler so we don't ever forget
This commit is contained in:
parent
6c15b862cd
commit
565fb05d85
|
@ -252,4 +252,8 @@ function respondErr(event: MessageEvent, err: string) {
|
||||||
clearIncomingQuery(event.data.nonce);
|
clearIncomingQuery(event.data.nonce);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof importScripts === "function") {
|
||||||
|
onmessage = handleMessage;
|
||||||
|
}
|
||||||
|
|
||||||
export { ActiveQuery, addHandler, DataFn, handleMessage };
|
export { ActiveQuery, addHandler, DataFn, handleMessage };
|
||||||
|
|
Loading…
Reference in New Issue