|
@@ -1,13 +1,13 @@
|
1
|
|
-import _ from 'lodash';
|
2
|
|
-import * as remx from 'remx';
|
|
1
|
+const _ = require('lodash');
|
|
2
|
+const remx = require('remx');
|
3
|
3
|
|
4
|
|
-export const state = remx.state({
|
|
4
|
+const state = remx.state({
|
5
|
5
|
person: {
|
6
|
6
|
name: 'no name'
|
7
|
7
|
}
|
8
|
8
|
});
|
9
|
9
|
|
10
|
|
-export const setters = remx.setters({
|
|
10
|
+const setters = remx.setters({
|
11
|
11
|
setName(newName) {
|
12
|
12
|
state.person.name = newName;
|
13
|
13
|
},
|
|
@@ -17,7 +17,7 @@ export const setters = remx.setters({
|
17
|
17
|
}
|
18
|
18
|
});
|
19
|
19
|
|
20
|
|
-export const getters = remx.getters({
|
|
20
|
+const getters = remx.getters({
|
21
|
21
|
getName() {
|
22
|
22
|
return _.get(state, ['person', 'name']);
|
23
|
23
|
},
|
|
@@ -26,3 +26,8 @@ export const getters = remx.getters({
|
26
|
26
|
return _(state).get('person.age');
|
27
|
27
|
}
|
28
|
28
|
});
|
|
29
|
+
|
|
30
|
+module.exports = {
|
|
31
|
+ setters,
|
|
32
|
+ getters
|
|
33
|
+};
|