Change another module state from one module in Vuex : <p>I have two modules in my vuex store.</p>

<pre><code>var store = new Vuex.Store({
    modules: {
        loading: loading 
        posts: posts
    }
});
</code></pre>

<p>In the module <code>loading</code>, I have a property <code>saving</code> which can be set either <code>true</code> or <code>false</code> and also have a mutation function named <code>TOGGLE_SAVING</code> to set this property.</p>

<p>In the module <code>posts</code>, before and after fetching posts, I want to change the property <code>saving</code>. I am doing it by calling <code>commit('TOGGLE_SAVING')</code> from one of the actions in the <code>posts</code> module. </p>

<pre><code>var getPosts = function (context) {
    contex.commit(TOGGLE_LOADING);
};
</code></pre>

<p>When it tried to commit, I got following error in the console</p>

<pre><code>[vuex] unknown local mutation type: TOGGLE_LOADING, global type: posts/TOGGLE_LOADING 
</code></pre>

<p>How can I mutate state in another module using <code>commit</code>?</p>
