title: Vue + Vuex using axios asynchrnously yet getters return empty array
body: <p>My issue is getters that are returning initial state (<code>[]</code>).</p>
  
  <p>in my component I have a <code>created</code> method that sets the axios call result into state.</p>
  
  <p><code>created() {this.$store.dispatch("SET_STORIES");},</code></p>
  
  <p>I have mapGetters in computed:</p>
  
  <pre><code>  computed: {
      ...mapGetters(["GET_STORIES"])
    },
  </code></pre>
  
  <p>And a method to get state:</p>
  
  <pre><code>  methods: {
      stories() {
        return this.$store.getters.GET_STORIES;
      }
    }
  </code></pre>
  
  <p><code>mounted()</code> is returning an empty array:</p>
  
  <pre><code>  mounted() {
      console.log("stories", this.$store.getters.GET_STORIES);
    },
  </code></pre>
  
  <h2>store.js</h2>
  
  <pre><code>import Vue from "vue";
  import Vuex from "vuex";
  import axios from "axios";
  import VueAxios from "vue-axios";
  import chunk from "lodash/chunk";
  Vue.use(Vuex, VueAxios, axios);
  
  export default new Vuex.Store({
    state: {
      stories: [],
      twoChunkStories: []
    },
    getters: {
      GET_STORIES: state =&gt; {
        return state.stories;
      }
    },
    mutations: {
      SET_STORIES(state, stories) {
        state.stories = stories;
      },
      SET_CHUNKED_STORIES(state, stories) {
        state.twoChunkStories= stories;
      },
    },
    actions: {
      SET_STORIES: async ({ commit }) =&gt; {
        const options = {
          headers: {
            "Content-Type": "application/json"
          }
        };
        let { data } = await axios.get(
          "https://api.example.com/get.json",
          options
        );
        if (data.meta.code === 200) {
          let storiesArray = data.data.stories;
          let chunkSize = 2;
          commit("SET_STORIES", storiesArray);
          let chunkedArray = chunk(storiesArray, chunkSize);
          commit("SET_CHUNKED_STORIES", chunkedArray);
        }
      }
    }
  });
  </code></pre>
  
  <p>How can I make an axios async call that would have state set onload on the earliest lifecycle hook (I thought <code>created()</code> was the earliest hook) and be ready to be called out on mounted. I'm obviously doing something wrong asynchronously over the getters, I just don't know exactly what.</p>