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(utils): improve freezeAtom and freezeAtomCreator #2476

Merged
merged 2 commits into from Apr 7, 2024

Conversation

backbone87
Copy link
Contributor

Related Issues or Discussions

None

Summary

Extends the freezeAtomCreator test to unveil a bug

Check List

  • yarn run prettier for formatting code and docs

Copy link

vercel bot commented Apr 2, 2024

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

Name Status Preview Comments Updated (UTC)
jotai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 7, 2024 0:00am

Copy link

codesandbox-ci bot commented Apr 2, 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.

Copy link

github-actions bot commented Apr 2, 2024

LiveCodes Preview in LiveCodes

Latest commit: 5feadb8
Last updated: Apr 7, 2024 11:59am (UTC)

Playground Link
React demo https://livecodes.io?x=id/7PSU5JVSZ

See documentations for usage instructions.

@dai-shi
Copy link
Member

dai-shi commented Apr 2, 2024

Thanks for the catch. Can you also fix it?

@backbone87
Copy link
Contributor Author

added a fix and expanded the test case to check for deep freeze. also applied the same strategy that is used in freezeAtomCreator to freezeAtom since the latter didnt handle non-primitive atoms (non-derived atoms with custom setter).

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
Thanks for working on this.

Now, I think freezeAtomCreator isn't very useful.
I don't think it's widely used, and it's easy to create one on users end.
I'll work on a separate PR.

@dai-shi dai-shi added this to the v2.8.0 milestone Apr 7, 2024
@dai-shi dai-shi changed the title failing test case for freezeAtomCreator fix(utils): improve freezeAtom and freezeAtomCreator Apr 7, 2024
@dai-shi dai-shi merged commit 93a28f4 into pmndrs:main Apr 7, 2024
37 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.

None yet

2 participants