title: Error TypeError: Cannot read property 'dispatch' of undefined at app.js:12012
body: <p>Hi I've been trying to learn vuejs and vuex while trying to get response from an api call with vuex concept I got the following error.Please help. 
  This error occurred<br>
  Error TypeError: Cannot read property 'dispatch' of undefined
      at app.js:12012</p>
  
  <p>loginAction.js</p>
  
  <pre><code>export const getUsersList = function (store) {
  
      let url = '/Apis/allUsers';
      Vue.http.get(url).then((response) =&gt; {
  
              store.dispatch('GET_USER_RES', response.data);
          if (response.status == 200) {
  
          }
      }).catch((response) =&gt; {
          console.log('Error', response)
      })
  }
  </code></pre>
  
  <p>loginStore.js</p>
  
  <pre><code>const state = {
      userResponse: []
  }
  const mutations = {
      GET_USER_RES (state, userResponse) {
          state.userResponse = userResponse;
      }
  }
  export default {
      state, mutations
  }
  </code></pre>
  
  <p>login.vue</p>
  
  <pre><code>import {getUsersList} from './loginAction';
  export default {
  
      created () {
          try{
              getUsersList();
          }catch(e){
              console.log(e);
          }
      },
      vuex: {
              getters: {
                  getUsersList: state =&gt; state.userResponse
              },
              actions: {
                  getUsersList
              }
      }
      }
      &lt;/ script&gt;
  </code></pre>