> For the complete documentation index, see [llms.txt](https://jonathan-zhang.gitbook.io/react-steppitguide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jonathan-zhang.gitbook.io/react-steppitguide/zhuang-tai-guan-li/redux_use/redux-zi-zhi-arr-zhong-jian-jian.md).

# Redux 自制arr中间件

```javascript
const arrMid = ({dispatch, getState}) => next => action => {
  //如果是函数，执行一下
  if (Array.isArray(action)) {
    return action.forEach(v=>dispatch(v))
  }
  //默认什么都没做，继续执行下一个
  return next(action)
}
export default arrMid
```
