How to submit global changes in module operations: Vuex
<p>I have an action and a global change in a namespace module (i.e. not in the module). I want to be able to commit global changes in the action. </p>
<pre class="brush:php;toolbar:false;">//Global changes
export default {
globalMutation (state, payload) {
...
}
}
//Actions in namespace modules
export default {
namespaced: true,
actions: {
namespacedAction ({ commit, dispatch, state }, payload) {
commit({ type: 'globalMutation' })
}
}
}</pre>
<p>When dispatching a namespace action, Vuex displays: </p>
<pre class="brush:php;toolbar:false;">[vuex] unknown local mutation type: globalMutation, global type: module/globalMutation</pre>
<p>Can I invoke this global change by passing an option to the <code>commit</code> function? </p>