pmndrs / zustand

🐻 Bear necessities for state management in React
https://zustand-demo.pmnd.rs/
MIT License
46.93k stars 1.45k forks source link

(docs) remove unintended change from default merge behaviour to identical but manual one #2661

Closed vorant94 closed 2 months ago

vorant94 commented 2 months ago

Related Bug Reports or Discussions

Fixes #

Summary

targeted section of the README talks about integration with redux devtools. to accomplish this the dev needs to define third argument for set function. since arguments for set function are positional it means he/she needs to define the second, replace, argument as well

currently README suggests just to use false value for replace arg i.e. to override the default value by identical manual one, but defined on the dev side.

more clean way would be to use undefined at the second argument position that will make JS itself to use the default value, meaning moving control of it back lib authors, not dev

Check List

vercel[bot] commented 2 months ago

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 Aug 2, 2024 1:17pm
codesandbox-ci[bot] commented 2 months ago

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.