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 Immer current usage when calling addManyMutably more than once #4420

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

JacobShafer
Copy link
Contributor

@JacobShafer JacobShafer commented May 21, 2024

A getCurrent() util was created that checks if the value is draftable before calling current(value). Asequence of addOne() + addOne() hits the case where now state.ids is a plain array, and thus current(state.ids) will throw because it's a plain value and not a draft.

Resolves: #4411

Copy link

codesandbox bot commented May 21, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

codesandbox-ci bot commented May 21, 2024

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 b1b845a:

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 May 21, 2024

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

Name Link
🔨 Latest commit b1b845a
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/667ec9554ecd5300088c5600
😎 Deploy Preview https://deploy-preview-4420--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.

@EskiMojo14 EskiMojo14 merged commit 09c36a2 into reduxjs:master Jun 28, 2024
28 checks passed
@EskiMojo14
Copy link
Collaborator

thanks!

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.

listenerMiddleware/error Error: [Immer] 'current' expects a draft, got:
2 participants