Created
December 28, 2018 16:12
-
-
Save duncanmcclean/7afaab35ab9341cb481e182f7147768a to your computer and use it in GitHub Desktop.
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
import Vue from 'vue' | |
import Vuex from 'vuex' | |
Vue.use(Vuex) | |
export default new Vuex.Store({ | |
state: { | |
user: { | |
bearer: '' | |
} | |
}, | |
mutations: { | |
bearer (state, payload) { | |
state.user.bearer = payload | |
} | |
}, | |
actions: { | |
bearer (context, payload) { | |
context.commit('bearer', payload) | |
} | |
}, | |
getters: { | |
bearer: state => { | |
return state.user.bearer | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment