failureCount value reset #3525
-
Hey! I have noticed that "failureCount" is set to 0 after refetchInterval is invoked, is this intended? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
the because of that, when a new fetch starts for whatever reason (can be a call to the docs are correct in saying:
because that's what's happening :) |
Beta Was this translation helpful? Give feedback.
failureCount
is the "internal" counter that tells you how often a query has failed while doing retries. For example, when if you have 3 retries configured (the default), the counter will go from 0 to 4. if it's on e.g.2
, your query will still be inloading
orfetching
state, but you can use this info to show a "something is taking longer than expected...` or so message to the user, if you want to.the
failureCount
is also passed to theretry
function so that you know how often it has failed.because of that, when a new fetch starts for whatever reason (can be a call to
refetch
, can be manual invalidation, can be a background refetch on window focus or, like in your case, an interval fetc…