Skip to content

Commit e2d69dd

Browse files
authored
Attempt reduxjs#6: applyMiddleware Code
const dispatch = store.dispatch; needs to be changed to: let dispatch = store.dispatch; because dispatch will updated later in the code
1 parent 827b627 commit e2d69dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/advanced/Middleware.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ Instead of `applyMiddlewareByMonkeypatching()`, we could write `applyMiddleware(
253253
function applyMiddleware(store, middlewares) {
254254
middlewares = middlewares.slice()
255255
middlewares.reverse()
256-
const dispatch = store.dispatch
256+
let dispatch = store.dispatch
257257
middlewares.forEach(middleware =>
258258
dispatch = middleware(store)(dispatch)
259259
)

0 commit comments

Comments
 (0)