Skip to content

Commit 7473e93

Browse files
committed
add once option
1 parent 069f5a2 commit 7473e93

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/toolkit/src/createAsyncThunk.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,11 @@ export const createAsyncThunk = /* @__PURE__ */ (() => {
620620
if (signal.aborted) {
621621
abort(externalAbortMessage)
622622
} else {
623-
signal.addEventListener('abort', () => abort(externalAbortMessage))
623+
signal.addEventListener(
624+
'abort',
625+
() => abort(externalAbortMessage),
626+
{ once: true },
627+
)
624628
}
625629
}
626630

0 commit comments

Comments
 (0)