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

split off signature without AsyncThunkConfig for better inference #1644

Merged
merged 2 commits into from
Oct 29, 2021

Conversation

phryneas
Copy link
Member

This supersedes #1626 and fixes #1605.

@loursbourg could you please give this a try?

@phryneas phryneas changed the base branch from master to v1.7.0-integration October 24, 2021 15:56
@codesandbox-ci
Copy link

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 4259c4b:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
redux-tookit-demo-1.6.1 Issue #1605
redux-tookit-demo-1.6.2 Issue #1605

@github-actions
Copy link

size-limit report 📦

Path Size
1. entry point: @reduxjs/toolkit (cjs.production.min.js) 12.28 KB (+0.41% 🔺)
1. entry point: @reduxjs/toolkit (esm.js) 10.27 KB (+0.5% 🔺)
1. entry point: @reduxjs/toolkit/query (cjs.production.min.js) 20.53 KB (+0.93% 🔺)
1. entry point: @reduxjs/toolkit/query (esm.js) 17.53 KB (+0.93% 🔺)
1. entry point: @reduxjs/toolkit/query/react (cjs.production.min.js) 22.6 KB (+1.75% 🔺)
1. entry point: @reduxjs/toolkit/query/react (esm.js) 20.15 KB (+1.66% 🔺)
2. entry point: @reduxjs/toolkit (without dependencies) (cjs.production.min.js) 5.6 KB (+0.88% 🔺)
2. entry point: @reduxjs/toolkit (without dependencies) (esm.js) 5.58 KB (+1.01% 🔺)
2. entry point: @reduxjs/toolkit/query (without dependencies) (cjs.production.min.js) 9.33 KB (+1.39% 🔺)
2. entry point: @reduxjs/toolkit/query (without dependencies) (esm.js) 9.69 KB (+1.17% 🔺)
2. entry point: @reduxjs/toolkit/query/react (without dependencies) (cjs.production.min.js) 2.6 KB (+10.03% 🔺)
2. entry point: @reduxjs/toolkit/query/react (without dependencies) (esm.js) 2.44 KB (+10.62% 🔺)
3. createSlice (esm.js) 5.16 KB (0%)
3. createEntityAdapter (esm.js) 5.83 KB (0%)
3. configureStore (esm.js) 5.83 KB (0%)
3. createApi (esm.js) 15.8 KB (+0.91% 🔺)
3. createApi (react) (esm.js) 18.37 KB (+1.8% 🔺)
3. fetchBaseQuery (esm.js) 10.99 KB (+0.61% 🔺)
3. setupListeners (esm.js) 9.85 KB (+0.57% 🔺)
3. ApiProvider (esm.js) 17.22 KB (+1.37% 🔺)

@netlify
Copy link

netlify bot commented Oct 24, 2021

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

🔨 Explore the source changes: 4259c4b

🔍 Inspect the deploy log: https://app.netlify.com/sites/redux-starter-kit-docs/deploys/61758231e4b57300088f2b02

😎 Browse the preview: https://deploy-preview-1644--redux-starter-kit-docs.netlify.app

@phryneas phryneas added this to the 1.7 milestone Oct 28, 2021
@loursbourg
Copy link
Contributor

Yeah this is actually a lot better, i did not think of splitting the function. Also, i was afraid that such changes may cause a breakage somewhere, thus, are not allowed. So my main focus was to make it work without changing anything else as the createAsyncThunk types got so complex that they became a lot harder to grasp for those who do not know what the original authors intended them to be.

Anyway, this made the reject with value recognize the return type, besides type tests are passing; so it is ready to integrate i guess?

Sorry for the late reply, i have been extremely busy last week

@phryneas phryneas merged commit 87b23b5 into v1.7.0-integration Oct 29, 2021
@phryneas phryneas deleted the fix-1605 branch October 29, 2021 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bug (?) with "action.payload" type inference in AsyncThunkFulfilledActionCreator
2 participants