redux-utilities/redux-actions

Return part of state as defaultState

Rey-The-Man opened this issue · 1 comments

Hello together

In my particular case we have split our actions and reducers for each component in our state, unfortunately some of those components need access to the whole state in their reducer, which means in my rootReducer i have to give them the whole state. Now if the action isn't handled in the reducer i want to give back just the component of the state and not the whole state. Is there a solution how i can handle that?

some of those components need access to the whole state in their reducer

By design, Redux only passes the reducer state and not the whole state to the reducer. This is not a conception by redux-actions.

If you need access to the whole state, you can do that by moving the logic to the action creators with redux-thunk and add additional payload to your action object.