2018-06-16 19:43:32 +00:00
|
|
|
import Vue from 'vue';
|
2018-06-03 22:45:01 +00:00
|
|
|
import Vuex from 'vuex';
|
2018-12-17 02:57:34 +00:00
|
|
|
import auth from './modules/auth';
|
|
|
|
import dashboard from './modules/dashboard';
|
|
|
|
import server from './modules/server';
|
|
|
|
import socket from './modules/socket';
|
|
|
|
import {ApplicationState} from "./types";
|
2018-06-03 22:45:01 +00:00
|
|
|
|
2018-06-16 19:43:32 +00:00
|
|
|
Vue.use(Vuex);
|
|
|
|
|
2018-12-17 02:57:34 +00:00
|
|
|
const store = new Vuex.Store<ApplicationState>({
|
2018-06-06 06:42:34 +00:00
|
|
|
strict: process.env.NODE_ENV !== 'production',
|
2018-08-02 06:37:14 +00:00
|
|
|
modules: {auth, dashboard, server, socket},
|
2018-06-16 19:43:32 +00:00
|
|
|
});
|
2018-06-16 21:05:39 +00:00
|
|
|
|
|
|
|
if (module.hot) {
|
|
|
|
module.hot.accept(['./modules/auth'], () => {
|
|
|
|
const newAuthModule = require('./modules/auth').default;
|
2018-07-16 00:53:40 +00:00
|
|
|
const newDashboardModule = require('./modules/dashboard').default;
|
2018-07-19 05:48:19 +00:00
|
|
|
const newServerModule = require('./modules/server').default;
|
2018-08-02 06:37:14 +00:00
|
|
|
const newSocketModule = require('./modules/socket').default;
|
2018-06-16 21:05:39 +00:00
|
|
|
|
|
|
|
store.hotUpdate({
|
2018-08-02 06:37:14 +00:00
|
|
|
modules: {
|
|
|
|
auth: newAuthModule,
|
|
|
|
dashboard: newDashboardModule,
|
|
|
|
server: newServerModule,
|
|
|
|
socket: newSocketModule
|
|
|
|
},
|
2018-06-16 21:05:39 +00:00
|
|
|
});
|
2018-06-03 22:45:01 +00:00
|
|
|
});
|
2018-06-16 21:05:39 +00:00
|
|
|
}
|
2018-06-03 22:45:01 +00:00
|
|
|
|
2018-06-16 21:05:39 +00:00
|
|
|
export default store;
|