With Redux, your app's state is defined by a reducer. Each navigation router effectively has a reducer, called getStateForAction.
还记得 Redux 的 GIF 嘛
我们需要稍微改变一下
正如你所看到的,这里还有一个概念:Middleware
从文档中看到:
It provides a third-party extension point between dispatching an action, and the moment it reaches the reducer
简而言之,这是一个函数,在 Action 到达 Reducer 之前,将使用 Action 调用该函数。
在这个功能中,你可以让 Action 继续前进,你可以阻止它继续前进,或者你可以改变它,并把它发送给下一个。