title: VUEJS + VUEX State reset everytime dispatch action
body: <p>Everytime i dispatch action in vuex it remove my old state of users and add dispatch actions to playlist. I don't know what is problem so sharing screenshot you may understand in image what i am trying to say.</p>
  
  <p>Thing is when application start it works fine with default values but when i add dispatch with some button or event then it remove user state object from vuex but keep playlist with new item in it. I know when dispatch playlist refresh vuex object but how to keep user object same time ?</p>
  
  <p>This is action i added and works fine but i have to do this every time i add something or if other actions then i have to apply same thing.</p>
  
  <p>Any idea i don't have to put user dispatch every time ?</p>
  
  <pre><code>addSongToList() {
      playlist.dispatch('addSong', { title: "Beside Me",
                      mp3: "http://dl.jatt.link/lq.jatt.link/cdn8/1a40cff114c5ee39b75dd3813c3f29dd/cdlzv/Ni%20Mainu-(Mr-Jatt.com).mp3",
                  });
      store.dispatch('updateUser', this.getUser );
  }
  </code></pre>
  
  <p>Thanks</p>
  
  <p>This is my playlist.js store file :</p>
  
  <pre><code>import Vuex from 'vuex'
  
  let state = {
      playerList: []
  };
  
  let getters = {
      getPlaylist: state =&gt; {
          return state.playerList
      }
  };
  
  let actions = {
      addSong: ({commit}, song) =&gt; {
          commit('ADD_SONG_TO_PLAYLIST', song)
      }
  };
  
  let mutations = {
      ADD_SONG_TO_PLAYLIST(state, song) {
          state.playerList.push(song)
      }
  };
  
  let playlist = new Vuex.Store({
      state,
      getters,
      mutations,
      actions,
  });
  
  global.playlist = playlist;
  
  export default playlist
  </code></pre>
  
  <p>This is user.js</p>
  
  <pre><code>import Vuex from 'vuex'
  import playlist from './playlist'
  
  let state = {
      user: {}
  };
  
  let getters = {
      getUser: state =&gt; {
          return state.user
      }
  };
  
  let actions = {
      updateUser: ({commit}, user) =&gt; {
          commit('ADD_USER', user)
      },
      deleteUser: ({commit}) =&gt; {
          commit('DELETE_USER')
      }
  };
  
  let mutations = {
      ADD_USER(state, user) {
          state.user = user
      },
      DELETE_USER(state) {
          state.user = null
      }
  };
  
  export default new Vuex.Store({
      state,
      getters,
      actions,
      modules: {
          playlist
      },
      mutations,
  })
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/7qtI7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7qtI7.png" alt="enter image description here"></a></p>