Open xiaocode opened 1 month ago
Yeah, I haven't implemented it yet, I wanted to test that the initial implementation is stable before going and implementing the subscription feature. Is that a critical feature for your use-case?
Yeah, I want to use websocket in nest.js with trpc, so Subscription is necessary.
I'll try and figure out how to incorporate the two then.
@xiaocode it seems like trpc
is using ws
as per their docs here.
I am thinking of going with the nest approach here for abstraction with the implementation to look something like this:
@Subscription("eventName", {
input: z.object({ userId: z.string() }),
output: z.string(),
})
async handleEvent(
@Input('userId') userId: string,
): string {
return userId
}
Wdyt?
It`s OK!
Hey @xiaocode, subscriptions will come when trpc v11
will go out of alpha.
I can not find @Subscription in package