How can I `useQueryClient` outside a Svelte component?
I'm using the excellent
I'd like to abstract my query functions and define them in
As part of this, I want to use
The problem seems to be with calling
Is there any better way to access the queryClient inside my
svelte-query – thanks so much Lachlan!I'd like to abstract my query functions and define them in
.ts files away from my .svelte files.As part of this, I want to use
onMutate and onSuccess functions to do optimistic updates etc, e.g.:The problem seems to be with calling
useQueryClient() outside of a Svelte component. I get this error:Is there any better way to access the queryClient inside my
.ts files or inside my query's callback functions?