Skip to content

Commit

Permalink
fix: fix the issue that useSWR revalidation isn't triggered if the
Browse files Browse the repository at this point in the history
useSWR call happens after mutation. E.g.:

   req------------->res
mutate------->end

In this case, the res would be ignored while req would not be triggered
a revalidation.
  • Loading branch information
Ponyets committed Jul 31, 2023
1 parent bf1cd03 commit f54525c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _internal/src/utils/mutate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export async function internalMutate<Data>(
cache
) as GlobalState

const revalidators = EVENT_REVALIDATORS[key]
const startRevalidate = () => {
const revalidators = EVENT_REVALIDATORS[key]
if (revalidate) {
// Invalidate the key by deleting the concurrent request markers so new
// requests will not be deduped.
Expand Down

0 comments on commit f54525c

Please sign in to comment.