Skip to content

Instantly share code, notes, and snippets.

@vouill
Last active December 4, 2017 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vouill/2e8cbd003b753f2390a935562cc54943 to your computer and use it in GitHub Desktop.
Save vouill/2e8cbd003b753f2390a935562cc54943 to your computer and use it in GitHub Desktop.
auth mutations
// basic mutations, showing loading, success, error to reflect the api call status and the token when loaded
const mutations = {
[AUTH_REQUEST]: (state) => {
state.status = 'loading'
},
[AUTH_SUCCESS]: (state, token) => {
state.status = 'success'
state.token = token
},
[AUTH_ERROR]: (state) => {
state.status = 'error'
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment