tRPC prefetching for Electron app
Hey 👋
I have a pretty basic Electron app, where I use tRPC to communicate with the server. I'd like to prefetch all the endpoints I'll need and display a loading screen, so that once the app is loaded the isn't any loading between switching pages. I saw that tRPC has a prefetch API for NextJS, is there something similar I could use in this situation?
1 Reply
Or I could just rely on the caching, shove all of my endpoints into one hook, call it on load and then once it loads proceed with the app?
I'm looking to use https://tanstack.com/query/v4/docs/guides/prefetching is this a good pattern to use?