-
Notifications
You must be signed in to change notification settings - Fork 70
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
[RFC] feat: Middlewares addition #263
Conversation
Add middlewares decorator Add middlewares test
Make `Middleware` a function interface Add multiple middleware functions test
This is great implementation! It's using a different approach as in #256, but achieves same semantics! |
One thing that I am not satisfied with is type inference in the decorator. It would be ideal if I could get the editor/language server to tell the developer what type the middleware arguments will be when the |
This sounds challenging. I think we can address in future PRs. Your current middleware implementation is general, easy-to-use and well tested. IMO, it's ready for merge. @volovyks Do you observe any issue regarding Petar's implementation? |
Add proper logging to output shown when verbose flag is active
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objections @ailisp , it is a great implementation.
Add middlewares decorator
Add middlewares test
Keep in mind that right now the
middleware
decorator needs to be applied after the other function decorators to preserve the capturing of the respective methods. This, however, could be changed if we want to change the way we capture the decorated methods, e.g. by adding a brand property to the decorated functions rather than looking for the name of the function decorator.Addresses #256