jotai icon indicating copy to clipboard operation
jotai copied to clipboard

RFC: Add `atomWithRefresh` in `jotai/utils`

Open dai-shi opened this issue 5 months ago • 4 comments

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. https://github.com/pmndrs/jotai/discussions/849#discussioncomment-8359658

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? 👍 / 👎

dai-shi avatar Feb 05 '24 04:02 dai-shi