Background Fetch and sync with cache. #1495
Answered
by
tannerlinsley
rajasekarm
asked this question in
Ideas
-
Use case Imagine Data is already fetched and cached, there are few data which is always changing. So if we have an option to return the cached data and trigger a query in the background and sync the data in cache will be useful. const { data, isBackgroundSyncing} = useQuery("repoData", () => {}, {backgroundSync: true}); isBackgroundSyncing helps to indicate the user that update is happening in the data. |
Beta Was this translation helpful? Give feedback.
Answered by
tannerlinsley
Dec 20, 2020
Replies: 1 comment
-
You can already do this by setting a staleTime on your query option and using the isFetching property on the resulting query info object. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rajasekarm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can already do this by setting a staleTime on your query option and using the isFetching property on the resulting query info object.