fix: if we are in a webworker, automatically setup the handler so we don't ever forget

This commit is contained in:
Derrick Hammer 2023-07-21 13:19:56 -04:00
parent 6c15b862cd
commit 565fb05d85
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 0 deletions

View File

@ -252,4 +252,8 @@ function respondErr(event: MessageEvent, err: string) {
clearIncomingQuery(event.data.nonce);
}
if (typeof importScripts === "function") {
onmessage = handleMessage;
}
export { ActiveQuery, addHandler, DataFn, handleMessage };