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

Selectors return shared mutable values #738

Open
wants to merge 3 commits into
base: 4.x
Choose a base branch
from

Conversation

elliottkember
Copy link

Addresses #737

@elliottkember
Copy link
Author

elliottkember commented Jan 16, 2025

The test:typescript tests were failing this PR, because of the way Readonly<Result> works. If the return type is null or any other type – readonly won't work and throws an error.

My solution here was to copy the Immutable definition from immer and use Immutable<Result> – which solves all the type errors. I don't know whether this is a desired approach (from a license or dependency standpoint) but it made the tests pass which is a good start.

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.

1 participant