I develop vue 2 application and I need to run setInterval for the few times and stop it after some time. This works fine
setInterval(() => {
console.log('function do this')
}, 2000)
bit this doesn't work as expected. actually it doesn't runs even once.
const refreshIntervalId = setInterval(() => {
console.log('function do this')
}, 2000)
/* later */
setTimeout(clearInterval(refreshIntervalId), 10000)
How can I start setInterval? Thanks