antares/src/renderer/store/index.js

32 lines
759 B
JavaScript
Raw Normal View History

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';
import workspaces from './modules/workspaces.store';
2020-05-15 17:52:59 +02:00
import notifications from './modules/notifications.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,
2020-05-15 17:52:59 +02:00
connections,
workspaces,
2020-05-15 17:52:59 +02:00
notifications
2020-05-12 18:27:31 +02:00
},
plugins: [vuexLocalStorage.plugin]
2020-05-04 17:33:50 +02:00
});