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 “mutations,” how do they work together, and moreso, I’m curious why the Vuex developers decided to do it this way?

13 Answers
13

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *