> 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-applymiddleware.md).

# Redux applyMiddleware

在之前我们对Redux进行异步操作的时候，使用到了`applyMiddleware(thunk)`中间件机制，它是帮助React扩展其功能的重要方法

首先我们要了解什么是中间件

## 中间件

中间件的特点：

* 中间件是独立的函数；
* 中间件可以组合使用；
* 中间件有一个统一的接口；

独立的函数是指中间件之间不应该有依赖关系，每个中间件应该能被独立使用，并完成一个特定的功能

### Redux中间件

![](https://3459259609-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MGDQNxkopeQ2T-3zxd2%2Fsync%2F4e96e0a022d5163c19e49d36e892a4886fcf65e1.png?generation=1599043702167276\&alt=media)
