Is there another way to reload the request after it has loaded successfully? We were using setTimeout to reload the code however the response data is fluctuating or is not accurate for every load.
`fetchFinished: function(){
var vm = this;
var finishedtodays = [];
var pendingsss = [];
vm.$http.get('/test').then(function(response){
this.finishedtoday = [];
this.pendingtasks = [];
var name = response.body.daily;
var name2 = response.body.pending;
vm.tablecounts = name;
console.log('test1')
//for finsihed today
name.forEach(function(key, value){
var count = key.daily_count;
var name = key.name
finishedtodays.push({"name": name.split(" ")[0], "count": count});
});
//for pending tasks
name2.forEach(function(key, value){
var firstname = key.name
var count = key.count
pendingsss.push({"name": firstname.split(" ")[0], "count": count});
});
vm.finishedtoday = finishedtodays;
vm.pendingtasks = pendingsss;
//for fetching all
vm.allcounts = response.body.allcount;
console.log("Test run");
}).catch(function(error){
});
setTimeout(this.fetchFinished.bind(this), 1000);
//setInterval(this.fetchFinished.bind(this), 10000);
// this.$forceUpdate();
}`
Is there another way to reload the request after it has loaded successfully? We were using setTimeout to reload the code however the response data is fluctuating or is not accurate for every load.
`fetchFinished: function(){