Kong / swrv

Stale-while-revalidate data fetching for Vue

Home Page:https://docs-swrv.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

useSWRV does not revalidate if you call `mutate` and render another component right after

edumudu opened this issue · comments

First of all, great lib, thanks

If you call the global mutate method and right after render a component that uses useSRWV, the cache is not revalidated

repro codesandbox

Steps To test

  • click on the button "go to Route 2"
  • click on the button "Change cache"
  • click on the button "go to Route 1"

if you open the browser dev tools and go to the networks tab you will see that the request to revalidate is not requested. If you wait a while in the Route 2 before go to Route 1, works fine