-
Notifications
You must be signed in to change notification settings - Fork 147
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
support variadic usage (rather than requiring an array) #63
Comments
i would personally like: function compose(...args) {
const middleware = _.flatten(args)
// ...
} @tj @juliangruber @dead-horse @fengmk2 thoughts? |
SGTM |
Awesome- I'll throw something together Monday if not sooner. |
* add variadic arg support ref #63 * remove array check * fix varargs test
gonna hold on this for now... but i don't mind publishing this as v4 after we've understood the use-case for mutating |
Any updates? Can we just check if the first item is an array?
|
IMO, it can be better if it supports both middleware and middlewares array BTW, it is overweight to use |
@Runrioter I'm not sure if that's really useful, but you can always add a check that composes them
|
With this you get better performance (see below) and support both
Current implementation:
This implementation:
|
I forgot the PR that added this got reverted and wasted a bunch of time debugging... any chance we'd be up for trying this again? Also, any news on "the use-case for mutating middleware"? |
this is just my ocd, but imo the latter looks much nicer:
vs
would you take a pr implementing this in a backward compatible way?
/cc @jonathanong
The text was updated successfully, but these errors were encountered: