Accessing other parts of the state, when using combined reducers

前端 未结 4 679
情歌与酒
情歌与酒 2020-12-29 05:42

NB: This is a question, very similar to Redux; accessing other parts... but it has nothing to do with Router :( thus cannot be solved s

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 05:57

    I use Thunk to getState(), prepare the data from the full store, then dispatch an action.

    You can put the decision logic in the reducer or in the action. It is up to you. I prefer fat actions and thin reducers but there is no right/wrong.

    Leonardo

提交回复
热议问题