index.js
634 Bytes
import Vue from 'vue';
import Vuex from 'vuex';
import {createYoho} from './yoho';
import {createProduct} from './product';
import {createChannel} from './channel';
import {createApi} from 'create-api';
Vue.use(Vuex);
export function createStore(context) {
const yoho = createYoho();
const product = createProduct();
const channel = createChannel();
const store = new Vuex.Store({
modules: {
product,
yoho,
channel
},
strict: process.env.NODE_ENV !== 'production'
});
const api = createApi(context);
store.$api = api;
return store;
}