Closed halindraprakoso closed 2 years ago
You are talking about window focus revalidation. Can you post a sample code with this revalidation call not being evaludated?
Maybe it's my misunderstanding, but my issue has since resolved by using mutate instead. Nevertheless, the issue was like the following: for instance I have this fetch:
let { data } = useSWR('profile', {
fetcher: () => fetcher(),
dedupingInterval: 900 * 1000
});
$data is displayed as a list. Then if I make some changes to the data, I want the list to display the fresh data, so I call:
revalidate('profile', { force: true })
I expected the refetch will happen immediately, but it's like what I described before.
It's strange...
First, can u try getting the revalidate
function that's given by useSWR instead of the global one?
It is strance, since when you're forcing, this should trigger the request:
https://github.com/ConsoleTVs/swrev/blob/master/src/SWR.ts#L108
ohh if I again passed on the fetcher function to the revalidate()
function, it refetches immediately!
hey first of all thanks for the awesome plugin.
when using
revalidate()
, it doesn't seem to refetch the data immediately, but I have to click out the window and click back again. is it possible to make it immediately fires when called?