Is there a way to trigger code execution when a variable changes?
For example: $store.state.AppStatus starts as "busy" when a Vue component is loaded and then changes to "ready"
I want to run a bootstrap function after $store.state.AppStatus changes to "ready"
Currently, I am using setTimeout but it's not ideal...
This is my code within the mounted hook:
mounted() {
if (window.location.hash) {
console.log(this.$store.state.AppStatus)
setTimeout(() => {
$(`a[href="${window.location.hash}"]`).tab('show')
}, 1000);
}
},