Do you want to request a _feature_ or report a _bug_?
feature.
What is the current behavior?
@param {...Function} middlewares The middleware chain to be applied.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.
no
What is the expected behavior?
receives array as param?
Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux?
all version
Because we can easily apply different middleware according to different environment, if applyMiddleware receives array as param.
If you want to send applyMiddlewares an array, why not just use something like ramda's apply? Or even the native js implementation on the Function prototype?
The variadic version is pretty widely used and accepted, its build into countless production apps, embedded in thousands of tutorials. The payoff for changing that api here seems small to me.
Usually I do something like this when I want to deal with different environnements
const middlewares = [
thunkMiddleware,
reactRouterMiddleware,
process.env.NODE_ENV !== 'production' && loggerMiddleware,
].filter(Boolean);
const enhancer = compose(applyMiddleware(...middlewares));
Oh i forgot that you can spread args like that, you don't even need to use any apply utility in that case 馃槀
Yep, should be doable in userland without any API changes.
Most helpful comment
Usually I do something like this when I want to deal with different environnements