Skip to content

Instantly share code, notes, and snippets.



Last active Dec 4, 2017
What would you like to do?
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
You can’t perform that action at this time.