"inferMiddlewareBuilderOptions" - A helper type to infer middleware options #6233
MlNl-PEKKA
started this conversation in
General
Replies: 1 comment 6 replies
-
|
https://trpc.io/docs/server/procedures#inferProcedureBuilderResolverOptions |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I came across a piece of code with piping middlewares, which could be improved by abstracting away some code into helper functions. One, it helped clean up the code. Two, it helped me with dropping non blocking tasks in a Promise.all.
Example:
A solution that I came up with was a "inferMiddlewareBuilderOptions" type which is a middleware counterpart to the "inferProcedureBuilderResolverOptions" helper type for procedures.
Could this be a useful addition to the library? And also, there are some internal types being used here, so is there any better solution to this?
Beta Was this translation helpful? Give feedback.
All reactions