注意到它始终是打开页面时调度的第一个操作。它是否用于使用reducer的默认状态初始化存储?
答案 0 :(得分:7)
我认为这会回答你的问题。
// When a store is created, an "INIT" action is dispatched so that every // reducer returns their initial state. This effectively populates // the initial state tree. dispatch({ type: ActionTypes.INIT })