-
I have logic to stop the polling from within the query But how to stop the polling in some other component when a Button is clicked. I tried this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@pdhruv93 Did you try using a shared state between the cancel button component and the one executing the polling? That is, adding that shared value to your condition:
Nonetheless this would make your
|
Beta Was this translation helpful? Give feedback.
@pdhruv93 Did you try using a shared state between the cancel button component and the one executing the polling? That is, adding that shared value to your condition:
Nonetheless this would make your
refetchInterval
callback an impure function stopping the polling based on an external value not present into yourdata
object, so you can use themeta
option to pass thatsharedValue
and extract it from inside yourrefetchInterval
callback through the query object that is the second parameter received by yourrefetchInterval
callback: