I have a function that is initially triggered within the 'mounted' lifecycle hook, and then it continues to be called every 15 minutes. In my component, I am looking to showcase a countdown until the next setInterval in minutes and seconds.
async mounted() {
this.retrieveData();
setInterval(function(){this.retrieveData(); }, 900000);
},
async retrieveData() {
this.loading = true;
const fetchData = await axios.get(`/api/v1/card/${this.card}`);
this.data = await fetchData.data.data;
this.loading = false;
}
Is there a way for me to continuously display the time remaining until the next setInterval is executed?