Use case: Calculation API #1562
Answered
by
TkDodo
rasmusfiskerbang
asked this question in
Q&A
-
|
Hi, I have a use case where I will ask an API to start a calculation by sending a POST to an endpoint: Any ideas about how I should go about this?
Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Jan 4, 2021
Replies: 1 comment 1 reply
-
|
My first thoughts are:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rasmusfiskerbang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My first thoughts are:
enabledoption for that.loadingstate until you get a valid result, so you can’t differentiate between loading and pending with that approach I think. If you want that, i think moving the success/pending state to a local useState (write to the state in onSuccess) and then enablerefetchIntervaldepending on it would work.