I have a countdown in the setInterval function something like this :
count =5;
let myparam =this; //Have also tried passing this as some param but doesn't work according to the link below
this.Timer = setInterval(() => {
if(count<=0)
{
//refresh the screen
}
else
{
this.template.querySelector('classname').innerhtml=count;
}
count-=1
},1000)
but the countdown doesn't decrease on the screen, the same works when I use bind(this), but I don't want to use it due to the fact that bind(this) creates a copy of function and might cause memory leakage and impact performance. Also, when I use bind(this), the timer takes some time to appear on the same due to interval. Therefore I wanted to separate setInterval and function to be called inside the set interval so that the function can be called before setting the Interval as well and hence counter won't take some time to display. Probably like
var timer=setInterval(updateTimer,1000);
where updateTimer is a arrow function but its doesn't work as well.
Any help is appreciated!!