T
tRPC

Show a spinner when any mutation is loading?

Show a spinner when any mutation is loading?

JFJack Fischer10/7/2022
Looking to show an activity spinner in the header of our application whenever a mutation is in flight (Hoping this will be easier than showing it in every conceivable place to say that your request is loading). There might be a few ways to do this, but any recommendations for minimal boilerplate?
UUUnknown User10/7/2022
Message Not Public
Sign In & Join Server To View
JFJack Fischer10/8/2022
Oh wow this is perfect thank you. Do you know if there's a way for mutations specifically? Or alternatively, a way to add some "middleware" to useMutation to control a semaphore in the background?
UUUnknown User10/8/2022
Message Not Public
Sign In & Join Server To View
JFJack Fischer10/8/2022
Ahh reference docs perfect. Thank you for this.

Looking for more? Join the community!

T
tRPC

Show a spinner when any mutation is loading?

Join Server
Recommended Posts
Sharing schemas between server and clientIn a typical nextJs setup, what is the idiomatic way to share zod schemas between frontend and backev10 Migration interop, router doesnt have attributesHi, i've tried to migrate like stated in the docs, these are my routers. Question: Shouldn't appRoutRecommended file structure for next.js?Hey all - using tRPC heavily with next.js and it's great. Our main `[trpc].ts` file is getting huge Unhandled Runtime ErrorTRPCClientErrorCall Stack Function.from node_modules\@trpc\client\dist\TRPCClientError-09b8a26b.esm.js (57:0) transSharing middleware between TRPC serversWe currently have *microservices* REST API's on Cloudflare Workers and I'm thinking about moving thiIs `trpc.withTRPC` for Next supposed to work with pages or only `_app`?I'd love to only have TRPC mount on certain pages of my Next.js app. Is this currently supported?Are there any example of subscriptions working with react native ?queries and mutations are working pretty well with react native, I'm unable however to get subscriptRecommended way to prefetch client-sideIn react-query, you can do ``` queryClient.prefetchQuery(['todos', input], queryFn) ``` In trpc, IRevalidate API route from procedureHi, is there a way to revalidate a statically generated page from a trpc procedure? https://nextjs.Modifying payload client-side before cachingSay I have a payload that includes something like `category_id` in each of the items returned e.g.: Response headersIs it possible to modify the response headers from server to client?API Response caching not working on vercel ⁉I've followed the instructions in https://trpc.io/docs/v9/caching for API Response caching and it's