Skip to content

Commit

Permalink
Remove unneeded chain declaration (#2928)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Brostoff authored and timdorr committed Apr 12, 2018
1 parent 7cb7414 commit ee5c563
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/applyMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ export default function applyMiddleware(...middlewares) {
`Other middleware would not be applied to this dispatch.`
)
}
let chain = []

const middlewareAPI = {
getState: store.getState,
dispatch: (...args) => dispatch(...args)
}
chain = middlewares.map(middleware => middleware(middlewareAPI))
const chain = middlewares.map(middleware => middleware(middlewareAPI))
dispatch = compose(...chain)(store.dispatch)

return {
Expand Down

0 comments on commit ee5c563

Please sign in to comment.