oa
oa
Explore posts from servers
TTCTheo's Typesafe Cult
Created by oa on 3/10/2023 in #questions
trpc global onError
i have trpc middleware logic that throws a code UNAUTHORIZED error if a user is not authenticated. when a trpc call happens i want to redirect the user to /login if they're unauthorized. i could add the redirect logic to all the api calls using onError, but wondering if there's an easier way to do this in one place
3 replies
TTCTheo's Typesafe Cult
Created by oa on 1/28/2023 in #questions
tRPC "Cannot destructure property 'client' of 'useContext(...)' as it is null"
3 replies
TTCTheo's Typesafe Cult
Created by oa on 11/6/2022 in #questions
accessing client side storage in next13 react server components
i'm trying out nextjs 13 and using their new routing. i have a page and loading component. i want to use localstorage/cookies/anything i can store on the client to get the user's session to get data in the page component. to do this i would have to switch to a client component which defeats the purpose. is there a workaround?
25 replies
TTCTheo's Typesafe Cult
Created by oa on 10/23/2022 in #questions
error while developing a react component library
8 replies
TTCTheo's Typesafe Cult
Created by oa on 9/29/2022 in #questions
writing tests for trpc
i am aware of theo's stance on tests, but we really need them we're building a payment gateway can't fuck with money. how do we write tests for trpc, couldn't find anything in the docs
2 replies