marv 🍵
marv 🍵
TTCTheo's Typesafe Cult
Created by marv 🍵 on 7/6/2024 in #questions
New to the t3 stack and tRPC, how do I share code between route functions correctly?
nvm i shoulda just read the fuckin docs https://trpc.io/docs/server/server-side-calls
5 replies
TTCTheo's Typesafe Cult
Created by marv 🍵 on 7/6/2024 in #questions
New to the t3 stack and tRPC, how do I share code between route functions correctly?
No description
5 replies
TTCTheo's Typesafe Cult
Created by marv 🍵 on 7/6/2024 in #questions
New to the t3 stack and tRPC, how do I share code between route functions correctly?
I think I figured it out just by adding
export type Context = Awaited<ReturnType<typeof createTRPCContext>>;
export type Context = Awaited<ReturnType<typeof createTRPCContext>>;
to my trpc.ts and importing that, but if there's a better way please let me know! especially since trpc.ts says YOU PROBABLY DON'T NEED TO EDIT THIS FILE, UNLESS: so i feel like this is still a hacky solution and not the correct way...
5 replies