-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
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
Let getFreshValue know whether the update is happening in the background or not #24
Comments
Hi Kent 👋 Sounds useful to me 👍 To be clear: When you say "In the background", you mean a case where the |
Exactly 👍 |
so that implementation can behave differently for background refresh scenarios fix: #24
Could you give The info is passed on the new GetFreshValueConext cachified({
/* ... */
ttl: 5,
staleWhileRevalidate: 20,
getFreshValue({ background }) {
console.log(background);
return 'value'
}
}); |
Sweet! I'll give this a try soon and report back. Thanks! |
Works great 👍 Thank you. |
Glad to hear that! It's released under |
Super, thanks a lot :) |
Here's what I've got:
I have the
abortTimeoutSignal
thing in place so gravatar won't cause me issues if my page is waiting on it. I think if my page is waiting on it I'd prefer that the timeout time be more like 500ms, but if the update is happening in the background (SWR) then I'm fine with it taking even 10 seconds. Thoughts? Maybe an argument passed togetFreshValue
?The text was updated successfully, but these errors were encountered: