Closed BasmaNabil closed 1 year ago
in my case for needing the status to be complete and on subsequent calls from different handlers in the same state scope, i did the following on a customWatcher function:
useWatchForTruthy(!isFetching && isSuccess, () => {
I'm honestly a bit irritated. status
has been deprecated since before RTK Query even was a part of Redux Toolkit.
We never removed it because having it there doesn't hurt, but we don't want people to use it, since status
doesn't tell you the whole story. Something could be isSuccessful
and isFetching
at the same time - that cannot be expressed as status
.
So yeah, please use the isLoading
etc. flags instead.
I was using status to get the state of the query('pending, rejected, fullfilled'), how can this be optained now form (isLoading, isFetching,....etc) or from where can i got this query state?
const {data, isLoading, isError, isFetching, status } = useGetUsersQuery()