Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support passing an external abortsignal to createAsyncThunk #4860

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

EskiMojo14
Copy link
Collaborator

closes #3924

enables calling dispatch(myThunk(arg, { signal })) (or dispatch(myThunk(undefined, { signal })) if no thunk arg)

@EskiMojo14 EskiMojo14 added the enhancement New feature or request label Feb 24, 2025
Copy link

codesandbox bot commented Feb 24, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

github-actions bot commented Feb 24, 2025

size-limit report 📦

Path Size
1. entry point: @reduxjs/toolkit/query/react (modern.mjs) 14.43 KB (+0.07% 🔺)
1. entry point: @reduxjs/toolkit (cjs, production.min.cjs) 14.19 KB (+0.34% 🔺)
1. entry point: @reduxjs/toolkit/react (cjs, production.min.cjs) 14.32 KB (+0.31% 🔺)
1. entry point: @reduxjs/toolkit/query (cjs, production.min.cjs) 23.3 KB (+0.18% 🔺)
1. entry point: @reduxjs/toolkit/query/react (cjs, production.min.cjs) 25.68 KB (+0.17% 🔺)
2. entry point: @reduxjs/toolkit (without dependencies) (cjs, production.min.cjs) 7.54 KB (+0.54% 🔺)
3. createAsyncThunk (.modern.mjs) 1.37 KB (+3.16% 🔺)
3. buildCreateSlice and asyncThunkCreator (.modern.mjs) 5.06 KB (+0.67% 🔺)
3. createApi (.modern.mjs) 14.85 KB (+0.37% 🔺)
3. createApi (react) (.modern.mjs) 16.89 KB (+0.32% 🔺)

Copy link

netlify bot commented Feb 24, 2025

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit ee00174
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/67bcf90a16b9ce0008220912
😎 Deploy Preview https://deploy-preview-4860--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codesandbox-ci bot commented Feb 24, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 602b0cd:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

Copy link

netlify bot commented Feb 24, 2025

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit 602b0cd
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/67bf79c8716ff500081d1646
😎 Deploy Preview https://deploy-preview-4860--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@schontz schontz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@schontz
Copy link

schontz commented Feb 25, 2025

Would documentation about this change be in a separate CR?

On that note, how would one know if their version of RTK has support for this feature? Do we put it into the docs ("Available since X.Y.Z") or is there some other mechanism?

@EskiMojo14 EskiMojo14 force-pushed the external-thunk-signal branch from 1a08211 to e331ef7 Compare February 25, 2025 17:04
@EskiMojo14
Copy link
Collaborator Author

@schontz added docs - we don't tend to include in the docs when a feature was added, so your best bet are the release notes.

@schontz
Copy link

schontz commented Feb 25, 2025

Got it. At any rate, TS will complain if you pass a signal on a previous version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support optional AbortSginal argument when dispatch thunk action
2 participants