Comments (4)
You are talking about window focus revalidation. Can you post a sample code with this revalidation call not being evaludated?
from sswr.
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.
from sswr.
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
from sswr.
ohh if I again passed on the fetcher function to the revalidate()
function, it refetches immediately!
from sswr.
Related Issues (20)
- Dependent fetching just doesn't work? HOT 12
- Support synchronous `fetcher` function HOT 3
- `fetcher` is sometimes ignored and it uses the default `fetch` HOT 1
- If `fetcher` returns `null` the revalidation is ignored HOT 1
- Add `isValidating` prop HOT 1
- revalidateOnMount missing? HOT 2
- Server side rendering SvelteKit example does not work
- SvelteKit - Named export 'SWR' not found HOT 3
- [HELP] Error: Function called outside component initialization
- Add option for polling interval
- Posible vite4 incompatibility HOT 2
- Multiple SWRs in one component keep resetting each other
- Dependent fetching doesn't revalidate when changing to an already cached value
- Svelte 4 support HOT 2
- Difference to @tanstack/svelte-query HOT 1
- Documentation typo: Global configuration options HOT 1
- SSWR no longer updating with longer `dedupingInterval`
- Is there a changelog?
- Quality control & maintenance of SSWR HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sswr.