React Query has a useful hook called useIsFetching (see docs), which allows checking whether a given query is currently fetching data, like so:
const queryCount = useIsFetching(['my-query-name'])
I want to do something very similar: I want to know for a given endpoint, if data has already been fetched (isFetched).
I know this is returned from the useQuery hook, but using this hook would call the endpoint again, and I want to avoid the repeated call.
Any ideas how to achieve this?