Consider the following scenario: I have a module where I need to perform certain tasks repeatedly, and these tasks depend on a value obtained from a getter that is not updating correctly. How can I ensure that this getter stays in sync with my Vuex state? Thank you.
Within my Vuex
:
import { start, stop } from './externa-module.js
START_ACTION ({getters}) {
start(getters.myVuexGetters);
}
Within my external-module.js
let myVuexGetter = null;
function doSomeStuffRepeatedly(){
console.log(myVuexGetter);
}
export function start(importedGetter){
myVuexGetter = importedGetter;
doSomeStuffRepeatedly();
}