Reputation: 738
I ran into the following problem:
So reducerBar is dependent on a state change in reducerFoo.
What would be a clean solution to solve this problem?
Upvotes: 0
Views: 1010
Reputation: 1018
You can use redux-saga
to dispatch another action based on the results of the previous call/action.
Upvotes: 0
Reputation: 4945
Using redux-thunk it looks something like this;
export function saveSnipEdit(item) {
return (dispatch, getState) => {
dispatch({type: 'SaveSnipEdit', item});
dispatch({type: 'ApiSetSnipData', data: {data: getState().snipData.allSnips}});
};
}
Upvotes: 1