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

feat(atomWithHash): initial value from hash #31

Merged
merged 4 commits into from
Feb 27, 2024

Conversation

Flirre
Copy link
Collaborator

@Flirre Flirre commented Feb 26, 2024

Added a test that triggers the problem mentioned in #10, if I read that issue correctly.
That test is added in 5f4e4c1

To fix that test, if a hash value with matching key is present in the url then it will used as the inital value for the strAtom, which results in the first render not using the otherwise defined initialValue.

Copy link

codesandbox-ci bot commented Feb 26, 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.

@Flirre Flirre changed the title Atom with initial value from hash feat(atomWithHash): initial value from hash Feb 26, 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.

Nice work!

Please see comments 👇

src/atomWithHash.ts Outdated Show resolved Hide resolved
src/atomWithHash.ts Outdated Show resolved Hide resolved
@dai-shi dai-shi linked an issue Feb 27, 2024 that may be closed by this pull request
src/atomWithHash.ts Outdated Show resolved Hide resolved
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

@Flirre Flirre merged commit 19a3c1a into jotaijs:main Feb 27, 2024
2 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.

atomWithHash initialValue from URL hash?
2 participants