vildantursic
vildantursic14mo ago

Cancel useQueries with single function

is there a way to abort useQueries with function call (e.g. cancel, abort)?
3 Replies
Jack Fischer
Jack Fischer14mo ago
Hey @vildantursic did you figure out an option here?
vildantursic
vildantursicOP14mo ago
Hey, nope, not yet
TkDodo 🔮
TkDodo 🔮14mo ago
the cancel method you get back from trpc utils is the same as queryClient.cancelQueries: https://trpc.io/docs/client/react/useUtils#helpers
useUtils | tRPC
useUtils is a hook that gives you access to helpers that let you manage the cached data of the queries you execute via @trpc/react-query. These helpers are actually thin wrappers around @tanstack/react-query's queryClient methods. If you want more in-depth information about options and usage patterns for useUtils helpers than what we provide her...