What's the difference between dispatch and next in Redux middleware?
export default function sampleMiddleware(store) {
return next => action => {
store.dispatch(action)
next(action)
}
}
What's the difference between dispatch and next in Redux middleware?
export default function sampleMiddleware(store) {
return next => action => {
store.dispatch(action)
next(action)
}
}
Dispatch initiates new action and it's go through full chain of middlewares.
Next – send current action into next middleware in chain.