keanu-weblite/src/store/index.js

33 lines
598 B
JavaScript
Raw Normal View History

2020-11-09 10:26:56 +01:00
import Vue from 'vue'
import Vuex from 'vuex'
2021-01-11 17:47:45 +01:00
import VuexPersist from 'vuex-persist'
2020-11-09 10:26:56 +01:00
import { auth } from './auth.module';
Vue.use(Vuex)
2021-01-11 17:47:45 +01:00
const vuexPersist = new VuexPersist({
key: 'settings',
storage: localStorage,
reducer: state => ({
currentRoomId: state.currentRoomId
})
})
2020-11-09 10:26:56 +01:00
export default new Vuex.Store({
state: {
currentRoomId: null
2020-11-09 10:26:56 +01:00
},
mutations: {
setCurrentRoomId(state, roomId) {
state.currentRoomId = roomId;
2020-11-09 10:26:56 +01:00
},
},
actions: {
},
modules: {
auth
},
2021-01-11 17:47:45 +01:00
plugins: [vuexPersist.plugin]
2020-11-09 10:26:56 +01:00
})