Closed
Description
Most of the real life examples (and the official documentation) introduce an extra and unnecessary step of having to use applyMiddleware
to create a function that is often named createStoreWithMiddleware
(not to mention the awkward, variadic applyMiddleware
syntax in the first place).
It would make sense to have a function createStoreWithMiddleware
with API:
createStoreWithMiddleware(middlewares: Array<Function>, reducer, [initialState]): Object
that is equivalent to calling:
createStoreWithMiddleware = applyMiddleware(logger)(createStore);
store = createStoreWithMiddleware(todos, [ 'Use Redux' ]);