Ways to purposely cause latency with T3? (For test purposes)

Using chrome's network throttle is actually useless because it only lags the first render (white screen), but the rest of the stuff are fast. If trpc doesn't have a way to simply do this, I'll just find a way with docker
2 Replies
Paco
Paco10mo ago
Add in some middleware that awaits some task like await new Promise((resolve) => setTimeout(resolve, 1000)); You could replace your current definitions for publicProcedure and protectedProcedure temporarily or only do this if a specific env var is set https://trpc.io/docs/server/middlewares
Middlewares | tRPC
You are able to add middleware(s) to a procedure with the t.procedure.use() method. The middleware(s) will wrap the invocation of the procedure and must pass through its return value.
deforestor
deforestorOP10mo ago
Clever! I'll try, thanks
Want results from more Discord servers?
Add your server