Vuex – passing multiple parameters to mutation

I am trying to authenticate a user using vuejs and laravel’s passport. I am not able to figure out how to send multiple parameters to the vuex mutation via an action. – store – export default new Vuex.Store({ state: { isAuth: !!localStorage.getItem(‘token’) }, getters: { isLoggedIn(state) { return state.isAuth } }, mutations: { authenticate(token, expiration) … Read more

Is there a way to dispatch actions between two namespaced vuex modules?

Is it possible to dispatch an action between namespaced modules? E.g. I have Vuex modules “gameboard” and “notification”. Each are namespaced. I would like to dispatch an action from the gameboard module in the notification module. I thought I could use the module name in the dispatch action name like this: // store/modules/gameboard.js const actions … Read more

Vuex Action vs Mutations

In Vuex, what is the logic of having both “actions” and “mutations?” I understand the logic of components not being able to modify state (which seems smart), but having both actions and mutations seems like you are writing one function to trigger another function, to then alter state. What is the difference between “actions” and … Read more