I am currently utilizing Vuex to store my data in a file called store.js. Within this setup, I have a mutation method named 'autoUpdateDb' as seen below:
store.js :
import Vuex from "vuex";
import Vue from "vue";
import { serv } from "./serviceMixin";
Vue.use(Vuex);
export default new Vuex.Store({
mutations: {
autoUpdateDb(state, payload) {
functionA();
},
},
actions: {}
});
However, when attempting to invoke the "autoUpdateDb" function, an error stating "(void 0) is undefined" is encountered. The actual function being called, 'functionA()', resides in another JavaScript file named serviceMixin.js
serviceMixin.js :
functionA(){
console.log("Hello");
}
Could you kindly guide me on the correct way to call the required function?
Many thanks!