-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow injecting extra arguments to middleware #6
Comments
In this case, you should use a Middleware object, you could access any context from an object. |
Yeah, using object as a closure could be a solution. I prefer the function way because it's easy to share in multiple places. |
Actually you could. You could inject a context to the arguments in the first middleware function since the arguments get passed though to all middleware functions. Yes, write a middleware function to control the context, that's the meaning of middleware. |
Do you mean passing through middleware chain by |
It will make sense if you think in middleware. |
Hi, I am searching for a
middleware
implement for our project. The solution looks promising.In our case, sometimes, the middleware need to know some context information to fulfill its task. So, I am wondering if it's possible to enable inject some extra argument to middleware to make the information available.
The proposal looks like:
The text was updated successfully, but these errors were encountered: