-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No typings for ctx
and env
?
#1
Comments
Hey, I'm glad you're getting value out of it. There's a Both the things you're trying to do should arguably be part of the library itself, but I'm not having any good ideas on how to do this right now. |
Thanks @qwtel. Can I build upon an existing middleware like the basics middleware? For example, if I wanted to type the route's createMiddleware({ downloadParams: {} }, async <BasicsContext>(ax) => {
const x = await ax;
return {
...x,
downloadParams: x.params as DownloadParams,
};
}); |
Yeah, you could create your own copy. The source is pretty short. |
This is an awesome lib and I'm getting a ton of value from it. I find myself having to jump through hoops to get things typed properly though. Perhaps I am doing things wrong?
Here is an example of how I'm trying to create a new
typedParams
middleware to add adownloadParams
object. And also adding typings forctx
andenv
(because otherwise they areany
type). Is there a better way to do this?The text was updated successfully, but these errors were encountered: