Polling until data is ready #3755
Unanswered
andresespinosapc
asked this question in
Q&A
Replies: 1 comment
-
refetchInterval can be a function so that you can do exactly this: polling until some condition is met. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have an endpoint that I have to request multiple times until the data is ready. When the data is not ready yet, it returns no data and a polling token to keep requesting the endpoint until the data is ready. When the data is ready, if I want to get the data again I have to start the polling again.
The behavior I'd want is that the data is only saved in the cache after the polling is complete. I can't use refetch to make the polling, because if I want to get the data again it will become
undefined
until the polling is completed again.How would you handle this case?
Beta Was this translation helpful? Give feedback.
All reactions