title: Vuex rest api consuming for scale
body: <p>I am building an application which consumes an API. 
  I'd like to be able to make a module builder with prefixed actions, and mutations, and also middleware for async operations, so I can easily expand the application.</p>
  
  <p>I built a prototype, but it feels like it is a draft and I am not sure it if follows flux pattern correctly. For example, my action types are not UPPERCASE </p>
  
  <pre><code>const defaultState = {
    [LOADING]: false,
    [DATA]: null,
    [ERRORS]: null,
  };
  
  const makeModule = moduleActions =&gt; ({
    namespaced: true,
    state: { ...defaultState },
    mutations: {
      fetch(state) {
        state[LOADING] = true;
        state[ERRORS] = null;
      },
      setData(state, data) {
        state[LOADING] = false;
        state[DATA] = data;
        state[ERRORS] = null;
      },
      setErrors(state, errors) {
        state[LOADING] = false;
        state[ERRORS] = errors;
      },
    },
    actions: moduleActions,
  });
  
  export {
    makeModule,
  };
  </code></pre>
  
  <p>After I construct my store using it: </p>
  
  <pre><code>const store = new Vuex.Store({
    modules: {
      [namespaces.cars]: makeModule({
        async getCars({ commit }) {
          commit('fetch');
        },
      }),
    },
  });
  </code></pre>
  
  <p>For react/redux I use <a href="https://github.com/infinitered/reduxsauce" rel="nofollow noreferrer">reduxsauce</a> which is working great for me.</p>
  
  <p>I tired finding something similar for Vuex, but with no luck. Can you recommend some best practices to follow, or a library that does this for you?</p>
  
  <p>Thanks</p>