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

useStore uses ReadonlyStoreApi #2586

Merged
merged 3 commits into from
Jun 26, 2024
Merged

Conversation

holic
Copy link
Contributor

@holic holic commented Jun 5, 2024

Related Issues or Discussions

Fixes #2581

Summary

UseBoundStore types were relaxed in #1589 because the internals of this method did not use any of the setters, only getters. We can also do this for useStore types because its API only uses getters.

Context: I am building a library that returns a store API with only getter methods exposed and I would like folks to be able to pass this directly into Zustand's useStore React helper.

Check List

  • pnpm run prettier for formatting code and docs

Copy link

vercel bot commented Jun 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zustand-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2024 2:36am

Copy link

codesandbox-ci bot commented Jun 5, 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.

@holic
Copy link
Contributor Author

holic commented Jun 5, 2024

Let me know if you want me to open a similar PR targeting the v5 branch.

Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

LGTM
I think I can take care of the rest. Thanks for your contribution!

Copy link

codesandbox-ci bot commented Jun 20, 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.

@dai-shi dai-shi added this to the v4.5.3 milestone Jun 26, 2024
@dai-shi dai-shi merged commit a262c9f into pmndrs:main Jun 26, 2024
39 checks passed
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.

2 participants