-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
36 lines (32 loc) · 864 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import Vue from "vue";
import Vuex from "vuex";
import feathersVuex from "feathers-vuex";
import feathersClient from "@/feathers";
const {
// service,
// auth,
FeathersVuex
} = feathersVuex(feathersClient, {
idField: "_id"
});
Vue.use(FeathersVuex);
Vue.use(Vuex);
const requireModule = require.context(
// The relative path holding the service modules
"./services",
// Whether to look in subfolders
false,
// Only include .js files (prevents duplicate imports)
/.js$/
);
const servicePlugins = requireModule
.keys()
.map(modulePath => requireModule(modulePath).default);
export default new Vuex.Store({
plugins: [
// Use the spread operator to register all of the imported plugins
...servicePlugins
// auth({ userService: 'users' }), // Populates user object on successful auth
// service('another-service'),
]
});