2018-06-16 20:43:32 +01:00
|
|
|
import Vue from 'vue';
|
2018-06-03 23:45:01 +01:00
|
|
|
import Vuex from 'vuex';
|
|
|
|
import { serverModule } from "./modules/server";
|
2018-06-11 20:06:12 +01:00
|
|
|
import { userModule } from './modules/user';
|
|
|
|
import { authModule } from "./modules/auth";
|
2018-06-03 23:45:01 +01:00
|
|
|
|
2018-06-16 20:43:32 +01:00
|
|
|
Vue.use(Vuex);
|
|
|
|
|
2018-06-16 22:05:39 +01:00
|
|
|
const store = new Vuex.Store({
|
2018-06-06 07:42:34 +01:00
|
|
|
strict: process.env.NODE_ENV !== 'production',
|
2018-07-16 00:50:11 +01:00
|
|
|
modules: { userModule, serverModule, authModule },
|
2018-06-16 20:43:32 +01:00
|
|
|
});
|
2018-06-16 22:05:39 +01:00
|
|
|
|
|
|
|
if (module.hot) {
|
|
|
|
module.hot.accept(['./modules/auth'], () => {
|
|
|
|
const newAuthModule = require('./modules/auth').default;
|
|
|
|
|
|
|
|
store.hotUpdate({
|
|
|
|
modules: { newAuthModule },
|
|
|
|
});
|
2018-06-03 23:45:01 +01:00
|
|
|
});
|
2018-06-16 22:05:39 +01:00
|
|
|
}
|
2018-06-03 23:45:01 +01:00
|
|
|
|
2018-06-16 22:05:39 +01:00
|
|
|
export default store;
|