nmeng
nmeng
Explore posts from servers
TtRPC
Created by nmeng on 6/12/2023 in #❓-help
One file per function call on the server side
Alright, that's what I'll do! Thanks 🙏
9 replies
TtRPC
Created by nmeng on 6/12/2023 in #❓-help
One file per function call on the server side
so would I from the endpoint file export e.g. const endpointFactory = (procedure) => procedure.input().query(() => { ... }) and then (in the app router) do router({ endpoint: endpointFactory(t.procedure), }) which seems ... over the top
9 replies
TtRPC
Created by nmeng on 6/12/2023 in #❓-help
One file per function call on the server side
I'd like to put the whole t.procedure.... into a separate file, not only the function passed to .query()
9 replies
TtRPC
Created by nmeng on 6/12/2023 in #❓-help
One file per function call on the server side
Hey, thanks @Nick Lucas -- the problem is that the function is created using the object from initTRPC.create(); (i.e. we do const t = initTRPC.create(); then const app = router({ endpoint: t.procedure.input(...).query(() => { .... }), });
9 replies