t
tRPC
t
tRPC
get queryClient from trpc to reset all cache on user logout
Original message was deleted
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,111
Members
View on Discord
A
Alex.dev
I can do something like this but it would be really helpful to just get reset fu...
M
mark salsbery
•
2/15/23, 7:06 PM
Didn
't you create the QueryClient and provide it to tRPC
? You should have access to it
.
N
Nick
•
2/15/23, 8:25 PM
^ that hook will create a new client for every instance
, it doesn
’t manage a singleton
N
Nick
•
2/15/23, 8:26 PM
React
-query already exports a useQueryClient hook
. Which will grab the instance from the React Context Provider
N
Nick
React-query already exports a useQueryClient hook. Which will grab the instance...
M
mark salsbery
•
2/15/23, 11:10 PM
Oops I grabbed that code from the wrong project
, where it
’s used in one place of course
Sorry for the useless example
, I
’ll edit that
…thanks for the heads up