vuex use state in action
// If you want to use state in action when using Vuex store
// all you need is to add 'state' next to commit in curly bracket '{ }'
// Exapmle:
someAction({commit, state}){
axios.get("https://myUrl.com/" + state.version )
.then((response) => {
commit('champions', {
champions: response.data.data
})
})
.catch(function (error) {
console.log(error);
})
}