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

Cache cant be changed if mutating happened before SWR fetching #1074

Closed
promer94 opened this issue Mar 27, 2021 · 0 comments · Fixed by #1075
Closed

Cache cant be changed if mutating happened before SWR fetching #1074

promer94 opened this issue Mar 27, 2021 · 0 comments · Fixed by #1075

Comments

@promer94
Copy link
Collaborator

Bug report

Description / Observed Behavior

when mutating with async function, if async function resolved after the fetcher, the swr cache can't be changed by mutate or fetcher

Expected Behavior

when mutating with async function, the fetcher result should be ignored.

Repro Steps / Code Example

https://codesandbox.io/s/swr-mutate-bug-eujb4?file=/src/index.tsx

Additional Context

SWR version. 0.5.4

Related to #1070

promer94 added a commit to promer94/swr that referenced this issue Mar 27, 2021
promer94 added a commit to promer94/swr that referenced this issue Mar 28, 2021
@promer94 promer94 mentioned this issue Mar 28, 2021
promer94 added a commit to promer94/swr that referenced this issue Mar 28, 2021
shuding pushed a commit that referenced this issue Mar 28, 2021
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.

1 participant