Skip to content

Commit c1d83ce

Browse files
committed
remove reference to DOMException
1 parent 421a657 commit c1d83ce

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/createAsyncThunk.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function createAsyncThunk<
115115
function abort(reason: string = 'Aborted.') {
116116
abortController.abort()
117117
abortAction = rejected(
118-
new DOMException(reason, 'AbortError'),
118+
{ name: 'AbortError', message: reason },
119119
requestId,
120120
args
121121
)
@@ -139,11 +139,7 @@ export function createAsyncThunk<
139139
args
140140
)
141141
} catch (err) {
142-
if (
143-
err instanceof DOMException &&
144-
err.name === 'AbortError' &&
145-
abortAction
146-
) {
142+
if (err && err.name === 'AbortError' && abortAction) {
147143
// abortAction has already been dispatched, no further action should be dispatched
148144
// by this thunk.
149145
// return a copy of the dispatched abortAction, but attach the AbortError to it.

0 commit comments

Comments
 (0)