Can a Redux action affect multiple parts of a state tree?

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

+8
javascript architecture reactjs redux
source share
2 answers

Yes, absolutely. Its reason is why actions exist: to separate what happened from the point of components from what actually happens in terms of state changes.

+7
source share

Yes, everything is in order. If that is what you want.

-one
source share

All Articles