We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Custom cache settings in 1.0.0-beta.8 disables revalidateOnFocus behaviour; focus and visibilitychange events are not revalidating SWR caches.
1.0.0-beta.8
revalidateOnFocus
focus
visibilitychange
Revalidate on focus on revalidateOnFocus: true, as non-cache version does.
revalidateOnFocus: true
CodePen: https://codepen.io/origin-master/pen/WNjwgYy
SWR version: 1.0.0-beta.8
registerOnFocus called in only here, and it's based on defaultConfig.cache:
registerOnFocus
defaultConfig.cache
swr/src/use-swr.ts
Lines 49 to 62 in c677d04
Current API encourages only cache from createCache(...) should be put into SWRConfig, and doesn't cares mutate:
cache
createCache(...)
SWRConfig
mutate
const { cache, mutate } = createCache(new Map()); const Config = () => <SWRConfig value={{ cache }} />
The text was updated successfully, but these errors were encountered:
huozhi
Successfully merging a pull request may close this issue.
Bug report
Description / Observed Behavior
Custom cache settings in
1.0.0-beta.8
disablesrevalidateOnFocus
behaviour;focus
andvisibilitychange
events are not revalidating SWR caches.Expected Behavior
Revalidate on focus on
revalidateOnFocus: true
, as non-cache version does.Repro Steps / Code Example
CodePen: https://codepen.io/origin-master/pen/WNjwgYy
Additional Context
SWR version: 1.0.0-beta.8
This can be a problem...
registerOnFocus
called in only here, and it's based ondefaultConfig.cache
:swr/src/use-swr.ts
Lines 49 to 62 in c677d04
Current API encourages only
cache
fromcreateCache(...)
should be put intoSWRConfig
, and doesn't caresmutate
:The text was updated successfully, but these errors were encountered: