can't update `atomWithDafault` by `set(RESET)`
See original GitHub issuesome useage:
const someAtom = atomWithDafault(async (get) => return fetch('some things'));
// ...
const updateSomeThing useUpdateAtom(someAtom);
const handleUpdate = useCallback(() => {updateSomeThing(RESET)}, [updateSomeThing]);
It’s nothing happend, the async (get) => return fetch('some things')
not be invoke, What’s more,
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Setting atom value when resetting selector doesn't work? #773
I want to properly reset it: like I when I would have refreshed the page. So, to cope with that, I built something...
Read more >atom(options) - Recoil
If a selector is used as the default the atom will dynamically update as the default selector updates. Once the atom is set,...
Read more >How to reset Atom packages to default - Stack Overflow
If you're on windows, my atom seems to be stored at "C:\Users\{user}\AppData\Local\atom". Here I have access to a folder named "packages".
Read more >Command line tools | Documentation (Version 2.4) | AtoM
You can do this by changing the value in the app.yml file located in /config/app.yml . The default timeout value in AtoM is...
Read more >Reset Atom Hub - Vera
Reset WiFi settings will clear corresponding settings on the Hub. Then, after restart, Hub will set up default access point that will make...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have did this by anothore atom, like :
Thank you, man!
atomWithDefault
is confusing me.The flip side is to focus on declarative pattern.
It’s a bit tricky but you might like it.