Use RECEIVE namespace rather than REQUEST
This brings the mutation type name closer to the associated action, so the documented example is more consistent.
This commit is contained in:
parent
425377f357
commit
0efff5d18d
1 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ In this file, we will write the actions that will call the respective mutations:
|
|||
|
||||
export const requestUsers = ({ commit }) => commit(types.REQUEST_USERS);
|
||||
export const receiveUsersSuccess = ({ commit }, data) => commit(types.RECEIVE_USERS_SUCCESS, data);
|
||||
export const receiveUsersError = ({ commit }, error) => commit(types.REQUEST_USERS_ERROR, error);
|
||||
export const receiveUsersError = ({ commit }, error) => commit(types.RECEIVE_USERS_ERROR, error);
|
||||
|
||||
export const fetchUsers = ({ state, dispatch }) => {
|
||||
dispatch('requestUsers');
|
||||
|
@ -175,7 +175,7 @@ Remember that actions only describe that something happened, they don't describe
|
|||
state.users = data;
|
||||
state.isLoading = false;
|
||||
},
|
||||
[types.REQUEST_USERS_ERROR](state, error) {
|
||||
[types.RECEIVE_USERS_ERROR](state, error) {
|
||||
state.isLoading = false;
|
||||
},
|
||||
[types.REQUEST_ADD_USER](state, user) {
|
||||
|
|
Loading…
Reference in a new issue