Skip to content

Commit

Permalink
fix(useWebWorker): prevent error event bubbling (#3141)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
Luvoy and antfu committed Aug 25, 2023
1 parent 6fabe9b commit 3420640
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/useWebWorkerFn/index.ts
Expand Up @@ -84,7 +84,7 @@ export function useWebWorkerFn<T extends (...fnArgs: any[]) => any>(fn: T,

newWorker.onerror = (e: ErrorEvent) => {
const { reject = () => {} } = promise.value

e.preventDefault()
reject(e)
workerTerminate('ERROR')
}
Expand Down

0 comments on commit 3420640

Please sign in to comment.