|
1 | 1 |
|
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 | +}; |
7 | 5 |
|
8 |
| - SET_COURSE (state, { course }) { |
9 |
| - state.course = course; |
10 |
| - }, |
| 6 | +const SET_COURSE = (state, { course }) => { |
| 7 | + state.course = course; |
| 8 | +}; |
11 | 9 |
|
12 |
| - SET_AUTHORS (state, { authors }) { |
13 |
| - state.authors = authors; |
14 |
| - }, |
| 10 | +const SET_AUTHORS = (state, { authors }) => { |
| 11 | + state.authors = authors; |
| 12 | +}; |
15 | 13 |
|
16 |
| - SET_AUTHOR (state, { author }) { |
17 |
| - state.author = author; |
18 |
| - }, |
| 14 | +const SET_AUTHOR = (state, { author }) => { |
| 15 | + state.author = author; |
| 16 | +}; |
19 | 17 |
|
20 |
| - INCREMENT_AJAX_CALLS (state) { |
21 |
| - state.ajaxCallsInProgress++; |
22 |
| - }, |
| 18 | +const INCREMENT_AJAX_CALLS = (state) => { |
| 19 | + state.ajaxCallsInProgress++; |
| 20 | +}; |
23 | 21 |
|
24 |
| - DECREMENT_AJAX_CALLS (state, params) { |
25 |
| - state.ajaxCallsInProgress--; |
| 22 | +const DECREMENT_AJAX_CALLS = (state, params) => { |
| 23 | + state.ajaxCallsInProgress--; |
26 | 24 |
|
27 |
| - if (params && params.error) state.ajaxError = params.error; |
28 |
| - }, |
| 25 | + if (params && params.error) state.ajaxError = params.error; |
| 26 | +}; |
29 | 27 |
|
30 |
| - SET_LOADING_FRAME (state, { frame }) { |
31 |
| - state.loadingFrame = frame; |
32 |
| - }, |
| 28 | +const SET_LOADING_FRAME = (state, { frame }) => { |
| 29 | + state.loadingFrame = frame; |
| 30 | +}; |
33 | 31 |
|
34 |
| - SET_SAVING (state, saving) { |
35 |
| - state.saving = saving; |
36 |
| - }, |
| 32 | +const SET_SAVING = (state, saving) => { |
| 33 | + state.saving = saving; |
| 34 | +}; |
37 | 35 |
|
38 |
| - SET_DELETING (state, deleting) { |
39 |
| - state.deleting = deleting; |
40 |
| - }, |
| 36 | +const SET_DELETING = (state, deleting) => { |
| 37 | + state.deleting = deleting; |
| 38 | +}; |
41 | 39 |
|
42 |
| - SET_ERRORS (state, errors) { |
43 |
| - state.errors = errors; |
44 |
| - }, |
| 40 | +const SET_ERRORS = (state, errors) => { |
| 41 | + state.errors = errors; |
| 42 | +}; |
45 | 43 |
|
46 |
| - SET_DIRTY (state, dirty) { |
47 |
| - state.dirty = dirty; |
48 |
| - }, |
| 44 | +const SET_DIRTY = (state, dirty) => { |
| 45 | + state.dirty = dirty; |
| 46 | +}; |
49 | 47 |
|
50 |
| - LOAD_COURSE (state, course) { |
51 |
| - state.course = course; |
52 |
| - }, |
| 48 | +const LOAD_COURSE = (state, course) => { |
| 49 | + state.course = course; |
| 50 | +}; |
53 | 51 |
|
54 |
| - LOAD_AUTHOR(state, author) { |
55 |
| - state.author = author; |
56 |
| - } |
| 52 | +const LOAD_AUTHOR = (state, author) => { |
| 53 | + state.author = author; |
| 54 | +}; |
57 | 55 |
|
| 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 |
58 | 70 | };
|
0 commit comments