I have a setinterval function that changes a variable in Vue's data.
When the tab loses focus and then regains it back the SetInterval tries to catch up and goes crazy.
I see the logic behind slowing it or stopping it completely to preserve resources or battery, but catching up is something I see no use of. What's a case in which a programmer would want a function to run every 5 seconds, but it will be fine if it runs 10 times every 0.3 seconds as well ...
Anyway, is there better solution or something I should add?
created() {
setInterval(() => this.moveSlider(), 7000);
},