Search code examples
vue.jsvuejs2vuexvue-devtools

How can I get vue DevTools to automatically commit vuex mutations?


I see these mutations: enter image description here

But it's only when I click the down arrow that they actually get committed. How can I have them commit automatically as the app progresses?


Solution

  • The down arrow (labelled "Commit All") only "commits" mutations in the Vuex history of the dev-tools. This mutation history allows you to inspect individual mutations and the state as it was when they were applied. It's only a debugging aid with state snapshots.

    Clicking "Commit All" simply squashes all the mutation history into a new "Base State". In other words, it discards the mutation history if it's too long for your needs. However this has nothing to do with committing mutations in the Vuex store however. The Vuex store always contains the latest state including all the mutations.

    So really I can't see the point in automatically clicking the down arrow because that is only debugging information which should be controlled explicitly as needed.