为什么在Redux中我们需要中间件来实现异步流?
问题: According to the docs, "Without middleware, Redux store only supports synchronous data flow" . 根据文档, “没有中间件,Redux存储仅支持同步数据流” 。 I don't understand why this is the case. 我不明白为什么会这样。 Why can't the container component call the async API, and then dispatch the actions? 为什么容器组件不能调用异步API,然后 dispatch 操作? For example, imagine a simple UI: a field and a button. 例如,想象一个简单的UI:一个字段和一个按钮。 When user pushes the button, the field gets populated with data from a remote server. 当用户按下按钮时,该字段将填充来自远程服务器的数据。 import * as React from 'react'; import * as Redux from 'redux'; import { Provider, connect } from 'react