import Vue from 'vue'
import Vuex from 'vuex'
import CreatePersistedstate from 'vuex-persistedstate'

import state from './state'
import mutations from './mutations'
import actions from './actions'
import getters from './getters'
import user from './modules/user'

Vue.use(Vuex);

export default new Vuex.Store({
    state,
    mutations,
    actions,
    getters,
    modules: {
        user
    },
    plugins: [
        CreatePersistedstate({
          storage: window.localStorage,
          paths: ['user']
        })
      ]
})