Get state of another reducer with react-redux
<p>I would like to know if it's possible, in a reducer, to get state of another reducer. I'm using react-redux :</p>

<pre><code>import * as reducers from "./client/components/reducers";
const reducer = combineReducers({
    ...reducers,
    routing : routerReducer,
});

const store = createStore(
  reducer,
  DevTools.instrument()
);
</code></pre>

<p>I have two reducers : wallets and operations.
When I add/update an operation, I want to calculate the total of my wallet and save it in my wallets reducer.</p>

<p>Here are my wallets reducer :</p>

<pre><code>import { INSERT, UPDATE, DELETE, UPDATE_ALL, SET_TOTAL } from "./wallets.constants";
import { INSERT as INSERT_OPERATION, UPDATE as UPDATE_OPERATION, DELETE as DELETE_OPERATION } from "../operations/operations.constants";

export default (state = initialState, action) =&gt; {
  const result = Object.assign({}, state);
  if (action.wallet &amp;&amp; !action.wallet.uuid) {
    return state;
  }
  switch(action.type) {
    case INSERT :
    case UPDATE :
    case DELETE :
      result[action.wallet.uuid] = action.wallet;
      return result;
    case INSERT_OPERATION :
    case UPDATE_OPERATION :
    case DELETE_OPERATION :
      // Here I want to calculate total of operations in this wallet
      return result;
    default : return state
  } 
}
</code></pre>

<p>I though to increment my total for each Insert instead of re-calculate all the total each time but if it's an Update it's not possible because I need to decrement old value that I don't have here.</p>

<p>Thank you for helping</p>