Reset the refetchInterval after request #2117
-
👋 Hello ! I have a project where I trigger a GET query every 10 seconds to retrieve some data, with the To fix that, I used the Thanks a lot for your help ! 🙏
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I think cancelling queries before writing to the cache is a good practice - all the examples do that with optimistic updates.
controlling a query can always be done with local state:
by setting the refetchInterval to a value depending on the data in onSuccess (0 if you want to turn it off), you'll re-render your component and the queryOptions update accordingly. |
Beta Was this translation helpful? Give feedback.
I think cancelling queries before writing to the cache is a good practice - all the examples do that with optimistic updates.
controlling a query can always be done with local state:
by setting the refetchInterval to a value depending on the data in onSuccess (0 if you want to turn it off), you'll re-render your…