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: withImmer doesn't work with resettable atom #11

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

tien
Copy link
Contributor

@tien tien commented Jun 23, 2024

Copy link

codesandbox-ci bot commented Jun 23, 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.

@tien tien force-pushed the fix/with-immer-on-resettable-atom branch from 0478a8b to aceb3e7 Compare June 23, 2024 11:39
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.

Oh, so it was just a type issue.

I'm not 100% sure how the order of overloads work, but it seems okay.

src/withImmer.ts Outdated Show resolved Hide resolved
@tien tien force-pushed the fix/with-immer-on-resettable-atom branch from aceb3e7 to 99cd630 Compare June 23, 2024 12:49
@tien
Copy link
Contributor Author

tien commented Jun 23, 2024

Oh, so it was just a type issue.

I'm not 100% sure how the order of overloads work, but it seems okay.

I believe it's like a switch case where the first matching pattern will be used, the original initial overload was too generic when I tested and ended up always shadowing the second overload.

@tien tien requested a review from dai-shi June 23, 2024 12:59
@dai-shi
Copy link
Member

dai-shi commented Jun 23, 2024

I was curious if the second pattern would ever match.

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.

The code looks good to me.
Thanks for your contribution!

@dai-shi dai-shi merged commit c13acc5 into jotaijs:main Jun 23, 2024
2 checks passed
@dai-shi
Copy link
Member

dai-shi commented Jun 23, 2024

@tien tien deleted the fix/with-immer-on-resettable-atom branch June 23, 2024 13:28
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