rsocket-js
rsocket-js copied to clipboard
RSocket routing definition alike tRPC
Routing is built by RSocket by default. https://github.com/rsocket/rsocket/blob/master/Extensions/Routing.md
Is it possible to define RSocket router alike tRPC? It's really easy for client and server sides.
const helloRouter = router({
hello: t.procedure
.input(
z.object({
name: z.string(),
}),
)
.request(({input}) => `hello ${input.name}` ),
hello2: publicProcedure
.input(z.string())
.fire(({input}) => {
console.log(input);
})
});