2020-05-04 17:33:50 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import Vue from 'vue';
|
|
|
|
import Vuex from 'vuex';
|
2020-05-12 18:27:31 +02:00
|
|
|
import VuexPersist from 'vuex-persist';
|
2020-05-04 17:33:50 +02:00
|
|
|
|
|
|
|
import application from './modules/application.store';
|
2020-05-08 18:02:18 +02:00
|
|
|
import connections from './modules/connections.store';
|
2020-05-04 17:33:50 +02:00
|
|
|
|
2020-05-12 18:27:31 +02:00
|
|
|
const vuexLocalStorage = new VuexPersist({
|
2020-05-14 15:21:57 +02:00
|
|
|
key: 'application', // The key to store the state on in the storage provider.
|
2020-05-12 18:27:31 +02:00
|
|
|
storage: window.localStorage,
|
|
|
|
reducer: state => ({
|
2020-05-14 15:21:57 +02:00
|
|
|
connections: state.connections
|
2020-05-12 18:27:31 +02:00
|
|
|
})
|
|
|
|
});
|
|
|
|
|
2020-05-04 17:33:50 +02:00
|
|
|
Vue.use(Vuex);
|
|
|
|
|
|
|
|
export default new Vuex.Store({
|
|
|
|
strict: true,
|
|
|
|
modules: {
|
2020-05-08 18:02:18 +02:00
|
|
|
application,
|
|
|
|
connections
|
2020-05-12 18:27:31 +02:00
|
|
|
},
|
|
|
|
plugins: [vuexLocalStorage.plugin]
|
2020-05-04 17:33:50 +02:00
|
|
|
});
|