Skip to content

Commit b9b16fa

Browse files
committed
Made mutations easier to determine code coverage for
1 parent 9e0bccc commit b9b16fa

File tree

1 file changed

+54
-42
lines changed

1 file changed

+54
-42
lines changed

src/store/mutations.js

+54-42
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,70 @@
11

2-
export const mutations = {
3-
4-
SET_COURSES (state, { courses }) {
5-
state.courses = courses;
6-
},
2+
const SET_COURSES = (state, { courses }) => {
3+
state.courses = courses;
4+
};
75

8-
SET_COURSE (state, { course }) {
9-
state.course = course;
10-
},
6+
const SET_COURSE = (state, { course }) => {
7+
state.course = course;
8+
};
119

12-
SET_AUTHORS (state, { authors }) {
13-
state.authors = authors;
14-
},
10+
const SET_AUTHORS = (state, { authors }) => {
11+
state.authors = authors;
12+
};
1513

16-
SET_AUTHOR (state, { author }) {
17-
state.author = author;
18-
},
14+
const SET_AUTHOR = (state, { author }) => {
15+
state.author = author;
16+
};
1917

20-
INCREMENT_AJAX_CALLS (state) {
21-
state.ajaxCallsInProgress++;
22-
},
18+
const INCREMENT_AJAX_CALLS = (state) => {
19+
state.ajaxCallsInProgress++;
20+
};
2321

24-
DECREMENT_AJAX_CALLS (state, params) {
25-
state.ajaxCallsInProgress--;
22+
const DECREMENT_AJAX_CALLS = (state, params) => {
23+
state.ajaxCallsInProgress--;
2624

27-
if (params && params.error) state.ajaxError = params.error;
28-
},
25+
if (params && params.error) state.ajaxError = params.error;
26+
};
2927

30-
SET_LOADING_FRAME (state, { frame }) {
31-
state.loadingFrame = frame;
32-
},
28+
const SET_LOADING_FRAME = (state, { frame }) => {
29+
state.loadingFrame = frame;
30+
};
3331

34-
SET_SAVING (state, saving) {
35-
state.saving = saving;
36-
},
32+
const SET_SAVING = (state, saving) => {
33+
state.saving = saving;
34+
};
3735

38-
SET_DELETING (state, deleting) {
39-
state.deleting = deleting;
40-
},
36+
const SET_DELETING = (state, deleting) => {
37+
state.deleting = deleting;
38+
};
4139

42-
SET_ERRORS (state, errors) {
43-
state.errors = errors;
44-
},
40+
const SET_ERRORS = (state, errors) => {
41+
state.errors = errors;
42+
};
4543

46-
SET_DIRTY (state, dirty) {
47-
state.dirty = dirty;
48-
},
44+
const SET_DIRTY = (state, dirty) => {
45+
state.dirty = dirty;
46+
};
4947

50-
LOAD_COURSE (state, course) {
51-
state.course = course;
52-
},
48+
const LOAD_COURSE = (state, course) => {
49+
state.course = course;
50+
};
5351

54-
LOAD_AUTHOR(state, author) {
55-
state.author = author;
56-
}
52+
const LOAD_AUTHOR = (state, author) => {
53+
state.author = author;
54+
};
5755

56+
export const mutations = {
57+
SET_COURSES,
58+
SET_COURSE,
59+
SET_AUTHOR,
60+
SET_AUTHORS,
61+
INCREMENT_AJAX_CALLS,
62+
DECREMENT_AJAX_CALLS,
63+
SET_LOADING_FRAME,
64+
SET_SAVING,
65+
SET_DELETING,
66+
SET_ERRORS,
67+
SET_DIRTY,
68+
LOAD_COURSE,
69+
LOAD_AUTHOR
5870
};

0 commit comments

Comments
 (0)