What is the consensus on an action affecting several parts of the state tree in Redux?
For example:
const ADD_POST = 'POST/ADD'; function postsReducer(state = initialState, action = {}) { // switch ... case ADD_POST: return { ...state, ...action.result.post } } function anotherReducer(state = initialState, action = {}) { // switch ... case ADD_POST: return { ...state, post_id: action.result.post.id } }
I am looking for advice:
Actions affecting multiple storage parts / reduction states
javascript architecture reactjs redux
AndrewMcLagan
source share