title: Multiple instances of a vuex module still share the same state?
body: <p><a href="https://vuex.vuejs.org/guide/modules.html#module-reuse" rel="nofollow noreferrer">According to the docs</a>, if I simply return the state as a function, I should be able to reuse the store module. However, when I did this, my vuex store module still shared state across all the component instances.</p>
  <p>Here's the component markup:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;template&gt;
      &lt;button class=&quot;button&quot; type=&quot;button&quot; @click=&quot;onClick&quot;&gt;{{ count }}&lt;/button&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
      import {mapState, mapMutations} from 'vuex';
  
      export default {
          name: 'sub-component',
          computed: {
              ...mapState('myModule', ['count'])
          },
          methods: {
              ...mapMutations('myModule', ['INCREMENT_COUNT']),
  
              onClick() {
                  this.INCREMENT_COUNT();
              }
          }
      };
  &lt;/script&gt;
  </code></pre>
  <p>Here's my store module:</p>
  <pre class="lang-js prettyprint-override"><code>const namespaced = true;
  
  const state = () =&gt; {
      return {
          count: 0
      };
  };
  
  const mutations = {
      INCREMENT_COUNT(state) {
          state.count++;
      },
  };
  
  export default {
      namespaced,
      state,
      mutations
  };
  
  </code></pre>
  <p>So, in my parent component, I have an arbitrary number of &quot;sub-component&quot; (button) instances. When I click, it does increment, but it increments for all of the instances. Is there a way to still utilize Vuex store without sharing the state across all the instances of my sub-component?</p>
  <p><em>Context:</em> I'm using Vuex in a SPA -- so a standard use-case for managing the state/methods across components in SPA. But I also have deeply nested components that interact and update other components in the SPA (but these other components need to maintain to their own state). Yes, I don't have to use Vuex, but it seemed like it would be cleaner.</p>