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(atomWithLocation): override replace for specific navigations #28

Merged
merged 9 commits into from
Feb 18, 2024

Conversation

Flirre
Copy link
Collaborator

@Flirre Flirre commented Feb 11, 2024

Sometimes you want to be able to both push and replace when navigating in the same file, without having to use useAtom twice creating two copies of the setLocation method.

This PR allows you to override your "replace" option for specific calls to the setLocation call.

@Flirre Flirre changed the title allow passing replace for specific navigations feat(atomWithLocation): override replace for specific navigations Feb 11, 2024
Copy link

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

looks good otherwise.

src/atomWithLocation.ts Outdated Show resolved Hide resolved
@Flirre Flirre requested a review from dai-shi February 12, 2024 21:30
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.

How about this?

src/atomWithLocation.ts Outdated Show resolved Hide resolved
src/atomWithLocation.ts Outdated Show resolved Hide resolved
src/atomWithLocation.ts Outdated Show resolved Hide resolved
src/atomWithLocation.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.

Thanks for your contribution!

@dai-shi dai-shi merged commit 73f8f4f into jotaijs:main Feb 18, 2024
2 checks passed
@dai-shi
Copy link
Member

dai-shi commented Feb 18, 2024

Published: https://www.npmjs.com/package/jotai-location/v/0.5.3

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