-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix mutate #1075
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 mutate #1075
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 536e25e:
|
For "cache cant update", this works: https://codesandbox.io/s/swr-mutate-bug-forked-95od2?file=/src/index.tsx. Simply conditionally return a fetcher. |
if you check the console.log, you will find fetcher never called. |
close vercel#1070; close vercel#1074;
Thank you! |
Ah, yes. You're totally right. This fix would help with a similar issue I have |
I managed to get it working by using |
cache cant update
https://codesandbox.io/s/swr-mutate-bug-eujb4?file=/src/index.tsx
inflight request should be ignored
https://codesandbox.io/s/swr-mutate-bug2-39199?file=/src/index.tsx
mutate should update data
https://codesandbox.io/s/useswr-async-mutate-bug-y77z1?file=/src/App.js
close #1070; close #1074;