isFetched vs isSuccess
Can anyone explain what the difference is between
isFetched
and isSuccess
?
I have seen some other developers using these two flags to determine if data is "ready" in our application, and after reading the docs, I am not clear what the impact would be of using one vs the other.2 Replies
foreign-sapphire•2y ago
isFetched is also true when the query errors
extended-salmonOP•2y ago
From what I could tell,
isSuccess
is more of a guarantee that the data
will not be undefined
(unless you explicitly return undefined
from your query function).
isFetched
doesn't do any type narrowing.