Wait invalidate infinite query
I have this function, I would like to await the invalidation because when I go back, I need to refetch all pages again and the card I "removed" takes some time to disappear, causing some bad user experience, there is a way to invalidate and wait all pages to be refetch before going back?
4 Replies
foreign-sapphire•2y ago
Instead of invalidating I think you can do refetch?
foreign-sapphire•2y ago
QueryClient | TanStack Query Docs
QueryClient
The QueryClient can be used to interact with a cache:
foreign-sapphire•2y ago
I think query client fetch query will do nothing if the cache is not stale
blank-aquamarineOP•2y ago
yeah, thats work
thank you!