index.js 524 Bytes
import Vue from 'vue';
import Vuex from 'vuex';
import {createApi} from 'create-api';
import storeYoho from './yoho';
import storeUfo from './ufo';
import storeCoupon from './coupon';

Vue.use(Vuex);

export function createStore(context) {
  const store = new Vuex.Store({
    namespaced: true,
    modules: {
      yoho: storeYoho(),
      ufo: storeUfo(),
      coupon: storeCoupon()
    },
    strict: process.env.NODE_ENV !== 'production'
  });

  const api = createApi(context);

  store.$api = api;

  return store;
}