Skip to content

feat(types): Support types until 10 handlers#1735

Merged
yusukebe merged 5 commits intohonojs:nextfrom
gabrielDonnantuoni:handle-more-than-5-handlers-typing
Nov 28, 2023
Merged

feat(types): Support types until 10 handlers#1735
yusukebe merged 5 commits intohonojs:nextfrom
gabrielDonnantuoni:handle-more-than-5-handlers-typing

Conversation

@gabrielDonnantuoni
Copy link
Copy Markdown
Contributor

Handle until 10 handlers on app.method([path], ...handlers) by simple adding more overloads.

This is not optimal by far. I'm compromised to find a better and beautiful solution, but until then I think this will cover more use cases, like I'm personally facing now.

Author should do the followings, if applicable

  • Add tests
  • Run tests
  • yarn denoify to generate files for Deno

@yusukebe
Copy link
Copy Markdown
Member

Hi @gabrielDonnantuoni !

Thank you for this PR. As you mentioned, while it may not be the best solution, it seems to be the only way available. It looks good, and I'll review the details later.

@yusukebe yusukebe changed the base branch from main to next November 28, 2023 08:30
Copy link
Copy Markdown
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabrielDonnantuoni

I would like to extend the OnHandlerInterface to also support 10 handlers:

export interface OnHandlerInterface<

Could you add the necessary code for this?

@gabrielDonnantuoni
Copy link
Copy Markdown
Contributor Author

OnHandlerInterface updated, @yusukebe 🤝

@yusukebe
Copy link
Copy Markdown
Member

@gabrielDonnantuoni

Great work!

Since this is a new feature, I'll merge it into the "next" branch for the upcoming minor release v3.11.0. It will be released later.

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants