Skip to content

Commit

Permalink
isAbortError
Browse files Browse the repository at this point in the history
  • Loading branch information
NotWoods committed Feb 4, 2024
1 parent 307ddee commit cfadab7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/client/page/hooks/usePromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export function usePromise(

useAbortEffect((signal) => {
effect(signal).catch((err: unknown) => {
if (err instanceof AbortError) {
if (
err instanceof AbortError ||
(err as { name?: unknown }).name === 'AbortError'
) {
// Ignore abort errors
return;
}
Expand Down

0 comments on commit cfadab7

Please sign in to comment.