creating middleware with context type as param
i'm looking into build a "post operation" function into separate piece of code. i know it may be done differently but i'm looking into it for code structure purpose. the goal of the middleware is to accept a function which takes the current context as input, as well as the result from the handler, and execute code.
my problems are:
1. i have no idea how to get the
C
(context) type right
2. the MiddlewareResult<>
type is not exposed from @trpc/server
so i can't pull it.
my questions are:
1. can it be done?
2. how difficult it should be?
3. somebody has pointer on it? help please
thanks0 Replies