Skip to content

Commit

Permalink
Refactors applyMiddleware to reduce confusion around createStore args. (
Browse files Browse the repository at this point in the history
#2201)

Because #2200 #2131#2128 #2028...
  • Loading branch information
jimbolla authored and timdorr committed Oct 6, 2017
1 parent 7a4cc71 commit b30e6ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/applyMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import compose from './compose'
* @returns {Function} A store enhancer applying the middleware.
*/
export default function applyMiddleware(...middlewares) {
return (createStore) => (reducer, preloadedState, enhancer) => {
const store = createStore(reducer, preloadedState, enhancer)
return (createStore) => (...args) => {
const store = createStore(...args)
let dispatch = store.dispatch
let chain = []

Expand Down

0 comments on commit b30e6ae

Please sign in to comment.