title: Vuex: Store module cyclic dependency
body: <p>I have the following situation:</p>
  
  <p><strong>store/index.js</strong></p>
  
  <pre><code>import moduleA from '@/store/module-a';
  import moduleB from '@/store/module-b';
  
  export default new Vuex.Store({
    modules: {
      A: moduleA,
      B: moduleB
    }
  });
  </code></pre>
  
  <p><strong>store/module-a.js</strong></p>
  
  <pre><code>export default {
    namespaced: true,
    state: {
      val: // constructed using localStorage
    }
  };
  </code></pre>
  
  <p><strong>store/module-b.js</strong></p>
  
  <pre><code>export default {
    namespaced: true,
    state: {
      val: // requires store/module-a.js state.val to construct
    },
    mutations: {
      add: function () {
        // requires store/module-a.js state.val
      }
    }
  };
  </code></pre>
  
  <p>If I try to <code>import store from '@/store</code> inside of module B, and then access <code>store.state.A.val</code>, I'd get a cyclic dependency, where <code>store --&gt; moduleB --&gt; store</code>.</p>
  
  <p>I can construct the <code>store.state.A.val</code> inside of module B, but that would be duplicating logic, and since module A is being loaded first, it would be nice if I could just access it from module A. Is that possible?</p>