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

add tests: can read sync derived atom in write without initializing #2824

Merged
merged 2 commits into from
Nov 17, 2024

Conversation

dmaskasky
Copy link
Collaborator

@dmaskasky dmaskasky commented Nov 16, 2024

Related Bug Reports or Discussions

#2789 (comment)

Summary

This PR adds two tests to enforce the behavior:

  • atoms accessed with write get should have their dependencies updated

Check List

  • pnpm run prettier for formatting code and docs

Copy link

vercel bot commented Nov 16, 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 Nov 17, 2024 9:16am

Copy link

codesandbox-ci bot commented Nov 16, 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 Nov 16, 2024

LiveCodes Preview in LiveCodes

Latest commit: 544f75b
Last updated: Nov 17, 2024 9:15am (UTC)

Playground Link
React demo https://livecodes.io?x=id/25FNJRBA9

See documentations for usage instructions.

@dmaskasky dmaskasky marked this pull request as draft November 16, 2024 23:47
@dmaskasky dmaskasky force-pushed the write-no-dep branch 2 times, most recently from 1cb491d to 77335fa Compare November 16, 2024 23:51
@dmaskasky dmaskasky changed the title atom.write getter does not add dependencies to dependents add tests: atoms accessed with write get should have their dependencies updated Nov 17, 2024
@dmaskasky dmaskasky requested a review from dai-shi November 17, 2024 02:50
@dmaskasky dmaskasky marked this pull request as ready for review November 17, 2024 02:50
@dai-shi dai-shi changed the title add tests: atoms accessed with write get should have their dependencies updated add tests: can read sync derived atom in write without initializing Nov 17, 2024
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.

Yeah, this is a behavior we should preserve.

tests/vanilla/dependency.test.tsx Outdated Show resolved Hide resolved
@dai-shi dai-shi merged commit 1bf91ce into pmndrs:main Nov 17, 2024
40 checks passed
@dmaskasky dmaskasky deleted the write-no-dep branch November 17, 2024 10:09
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