Replies: 5 comments
-
Can #7204 help you? Is this what you're looking for? Can you please fix your issue code? |
Beta Was this translation helpful? Give feedback.
-
Hi @frederikhors, thanks for replying. (Fixed the code 🤦) Unless I misunderstand, I don't think that's what I'm looking for. I've got queries with dynamic query keys and can't really predict which ones to call I'll see if I can whip up an example. |
Beta Was this translation helpful? Give feedback.
-
Okay this should illustrate my question: https://stackblitz.com/edit/tanstack-query-1u6ax4?file=src%2Findex.jsx |
Beta Was this translation helpful? Give feedback.
-
As an intermediate solution I've wrapped |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I've been a bit hesitant to post this question, since I feel others must've asked similar questions. I just can't find them!
I'm happily using a query with a 10-minute stale time. I don't want the query refetched every time the query is mounted, or when the user refocusses the tab, before the 10 minutes are up. This works great!
However, I'd like the persistently cache the data so the user can interact with stale data on app load, even as the query is refetched immediately to refresh the data. In other words, I want the hydrated data to be stale immediately, or to act as placeholder data. The intention is that the data is forced to be fresh after the user performs a page load one way or another. What currently happens, is that the cached data is hydrated and is still considered fresh, because the data is less than 10 minutes old.
I'm not sure how to configure this, or whether it's even possible at all.
👉 Example project to illustrate my question: https://stackblitz.com/edit/tanstack-query-1u6ax4?file=src%2Findex.jsx
Beta Was this translation helpful? Give feedback.
All reactions