Redux: Calling store.getState() in a reducer function, is that an anti pattern?
<p>I'm wondering, sometimes I have a reducer that needs information from another reducer. For example I have this reducer:</p>

<pre><code>import * as ActionTypes from '../actions/action_type_constants';
import KeyCode from 'keycode.js/index';
import {store} from "../index";
import {mod} from "../pure_functions";

export function selectedCompletion(state = 0, action) {
  if (action.type === ActionTypes.arrowKeyPressed) {
    const completionsLength = store.getState().completions.data.length;
    if (action.keyCode === KeyCode.UP) {
      return mod(state - 1, completionsLength);
    } else if (action.keyCode === KeyCode.DOWN) {
      return mod(state + 1, completionsLength);
    }
  }
  return state;
}
</code></pre>

<p>I do call store.getState at the second line of the function, because otherwise I can not determine the index correctly.</p>

<p>I could probably refactor this and the other reducer, so that it becomes one big reducer, but for readability I would prefer this option.</p>

<p>I'm not sure if I would get somehow into problems if I use this pattern of calling store.getState() in a reducer.</p>