Last active
December 4, 2017 11:11
-
-
Save vouill/2e8cbd003b753f2390a935562cc54943 to your computer and use it in GitHub Desktop.
auth mutations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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