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

Fix inference for reducers without actions specified #3475

Merged
merged 1 commit into from
May 30, 2023

Conversation

EskiMojo14
Copy link
Collaborator

fixes #3474

@codesandbox
Copy link

codesandbox bot commented May 25, 2023

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders | Preview

@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 b029318:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
reduxjs/redux-toolkit Configuration
reduxjs/redux-toolkit Configuration
reduxjs/redux-toolkit Configuration
reduxjs/redux-toolkit Configuration
Slice selector circular type (forked) Issue #3474

@EskiMojo14
Copy link
Collaborator Author

@einarq would you be able to try out the package built from this PR, see if it fixes your issue? 🙂

@einarq
Copy link

einarq commented May 25, 2023

Sure, how do I reference it?

@EskiMojo14
Copy link
Collaborator Author

There are install instructions here 😄

@einarq
Copy link

einarq commented May 25, 2023 via email

@EskiMojo14
Copy link
Collaborator Author

hmm, that image doesn't seem to display on github. Could you post a snippet, or adjust the codesandbox with an example?

@einarq
Copy link

einarq commented May 25, 2023

Didnt work when coming in via an email I guess, trying again.

image

Weird thing is that I'm unable to repro this on the sandbox

@einarq
Copy link

einarq commented May 25, 2023

@EskiMojo14
Copy link
Collaborator Author

ahh, I see - I'm tempted to say this is a good thing though, if you want a payload other than void you should provide it.

either by using the usual PayloadAction<Payload> or by doing create.reducer<Payload>(

@einarq
Copy link

einarq commented May 25, 2023 via email

@EskiMojo14
Copy link
Collaborator Author

in the meantime if you want the previous behaviour of using any you can always do something like

export type TODOFIXME = any;

create.reducer<TODOFIXME>((state, { payload: { orderDir } }) => {})

@einarq
Copy link

einarq commented May 25, 2023 via email

@markerikson markerikson merged commit 37b3723 into v2.0-integration May 30, 2023
@markerikson markerikson deleted the action-creator-without-payload-fix branch May 30, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants