Skip to content
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

How to type Fastify Prehandlers that have been extracted outside of the route? #1057

Closed
lifeiscontent opened this issue Sep 12, 2024 · 1 comment
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@lifeiscontent
Copy link

💬 I'm wondering how I should type my application code to use a Fastify preHandler outside of the route (extracted to a constant)

I've got this code here: https://github.com/lifeiscontent/fastify-example/pull/1/files
and I have created Application Types for the PreHandlers, but I'm wondering if there's a preferred way to do this.

Right now I have to manually specify if its Async or not, but it would be nice to just have the type system infer this for me rather than having to explicitly mark it, is there a preferred way of typing preHandlers that are passed into routes?

Your Environment

  • defined in project source
@lifeiscontent lifeiscontent added the help wanted Extra attention is needed label Sep 12, 2024
@dosubot dosubot bot added the question Further information is requested label Sep 12, 2024
@mcollina
Copy link
Member

Code is not available anymore. Sorry for the long delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants