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

RFC: Add atomWithRefresh in jotai/utils #2379

Closed
dai-shi opened this issue Feb 5, 2024 · 4 comments · Fixed by #2393
Closed

RFC: Add atomWithRefresh in jotai/utils #2379

dai-shi opened this issue Feb 5, 2024 · 4 comments · Fixed by #2393

Comments

@dai-shi
Copy link
Member

dai-shi commented Feb 5, 2024

atomWithRefresh has been a recipe, not a util.
We wanted to understand various use cases and thought the naive implementation was somewhat limited. My hesitation is also it can be overused, but that's probably a doc issue.

It's been a while and it seems the basic atomWithRefresh seems valuable. #849 (comment)

There might be several implementation ideas, like using a symbol like atomWithReset if that helps.

So, here's an RFC. Should we have atomWithRefresh in jotai/utils? 👍 / 👎

@AjaxSolutions
Copy link
Collaborator

How could we incorporate debouncing or throttling into atomWithRefresh?

@dai-shi
Copy link
Member Author

dai-shi commented Feb 8, 2024

I think it's the out of the scope of atomWithRefresh or even Jotai library, which means it's a good opportunity for Jotai Labs and Jotai ecosystem.

@dai-shi dai-shi mentioned this issue Feb 12, 2024
3 tasks
@dai-shi
Copy link
Member Author

dai-shi commented Feb 12, 2024

#2393 supports write too.

@dai-shi
Copy link
Member Author

dai-shi commented Feb 24, 2024

Accepted and #2393 is ready.

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 a pull request may close this issue.

2 participants