Skip to content

Commit

Permalink
Refactors applyMiddleware to reduce confusion around createStore args. (
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbolla authored and seantcoyote committed Jan 14, 2018
1 parent 14407f4 commit ecda836
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 ecda836

Please sign in to comment.