title: Vuex, best practice with a global errors and notifications handling
body: <p>here is what i do, and i'am not realy sure its correct : </p>
  
  <pre class="lang-js prettyprint-override"><code>//store
  async addUser({commit}) {
    try {
      const {data} = await apiService.addUser()
      commit('SET_USER', data)
      commit('SET_NOTIFICATION', {type:'success', message: 'user successfuly created'})
    } catch (error) {
      commit('SET_NOTIFICATION', {type:'error', message:error})
    }
  
  }
  
  SET_USER(state, user) {
      state.users.push(user)
  }
  
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>//my component:
  async addUser() {
    this.isLoading = true
    await this.$store.dispatch('updatePatient', this.form)
    this.isLoading = false
  }
  </code></pre>
  
  <p>is it legit ? </p>
  
  <p>sometimes i think i would need more logic inside my component depending on the succes or rejected api request. Should i put all the logic in my actions ? like i do at the moment ? </p>
  
  <p>Maybe should I add a status state for each actions, for example : </p>
  
  <pre class="lang-js prettyprint-override"><code>state {
    users: []
    postUserSuccess: null
    postUserError: false
    updateUserSuccess: null
    updateUserError: false
    // ...
  }
  </code></pre>
  
  <p>and do what i want in the component with a computed property mapped to the store ?</p>
  
  <p>What do you think ? </p>