-
-
Notifications
You must be signed in to change notification settings - Fork 649
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(util): atomWithDefault #379
Conversation
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. Latest deployment of this branch, based on commit 130e2e1:
|
This is a great helper, I was wondering if it makes sense to have |
tbh, i'm not very happy with it. we have atomWithReset too. we may have more helpers in the future. const myFamily = atomFamily(param => atom(...))
// then this is possible
const myFamily = atomFamily(param => atomWithDefault(...)) what do you think? worth a breaking change before v1? |
I do think so. I have noticed that for any of the utility atoms, I've been needing to wrap them with other kinds. such as wishing i could do |
Okay, the type would be much better too. Let's do that. |
Done: #385 |
Thanks for the review. I will merge this later with others. |
Close #352