title: Is it possible to dispatch an action inside Vuex itself when the Vue Instance is initiated?
body: <p>I've been researching and so far no luck finding the answer. Right now I have a store instance with 2 modules, but we'll be using the first as the example.</p>
  
  <p><strong>/Store/index.js</strong></p>
  
  <pre><code>import Vuex from 'vuex';
  Vue.use(Vuex);
  
  const store = new Vuex.Store({
      modules: {
          header: require('./modules/header/index').default,
          current_user: require('./modules/user/index').default,
      }
  });
  
  export default store
  </code></pre>
  
  <p><strong>/Store/modules/user/index.js</strong></p>
  
  <pre><code>const state = {
      information: [],
  }
  
  const mutations = {
      setInformation(state, data){
          state.information = data;
      }
  }
  
  const getters = {
      getFirstName(state){
          return state.information.first_name;
      },
      getProfileImage(state){
          return state.information.image;
      }
  }
  
  const actions = {
      requestInformation({commit}){
          axios.get('/app/account/requestUserInformation').then(response =&gt; commit('setInformation', response.data) );
      }
  }
  
  export default {
      state,
      mutations,
      getters,
      actions
  }
  </code></pre>
  
  <p>Right now I have an action <strong>requestInformation</strong>, and on another file named <strong>app.vue</strong> I'm calling it like so.</p>
  
  <pre><code>created(){
      this.$store.dispatch('requestInformation');
  }
  </code></pre>
  
  <p>I was wondering if it's possible to dispatch/make the request to the requestInformation from vuex itself instead of having to call it outside of the file, so as soon as the global store is initiated the requestInformation would be called.</p>
  
  <p>I'm trying to avoid having to dispatch the actions from different files.</p>