You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a metrics middleware that I want to use for all routes, but its needs access to some route specific strings. I've come up with this method using a closure to capture the extra parameters, but I'm not very satisfied with how it looks. I need to repeat the route, and the closure syntax is not easy to read.
I think what would be ideal is something more like the middleware function objects in Tide, they also have the concept of the current route so you can do something like:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a metrics middleware that I want to use for all routes, but its needs access to some route specific strings. I've come up with this method using a closure to capture the extra parameters, but I'm not very satisfied with how it looks. I need to repeat the route, and the closure syntax is not easy to read.
Does anyone have a suggestion for how to improve?
I think what would be ideal is something more like the middleware function objects in Tide, they also have the concept of the current route so you can do something like:
Beta Was this translation helpful? Give feedback.
All reactions