Redux/Este 中的 actions 如何连接到 reducers

How are the actions wired to reducers in Redux/Este

我正在使用Este starter kit to build a universal react app (it uses react-redux and react-router. Looking at the example on NewTodo component我可以理解connect用于将动作连接到组件。

export default connect(null, { addTodo })(NewTodo);

但我没有理解 reducer 是如何连线的?

在 Redux 应用程序中,reducer 通常是如何连接的?

待办事项缩减器或任何其他组件缩减器最终将导入到根缩减器中。这个 root reducer 可以代表你的整个 redux 状态树。在你的情况下,它是 this file

然后在您创建商店时使用此根减速器 (this file)。每次当你发送一个 action 时,store 都会将这个 action 广播给所有的 reducers(包括它的 sub-reducers)。如果 action.type 匹配,则 reducer 将相应地处理此操作。