Hey Tori. Great post! I loved the way you described the steps for achieving the final implementation, you explained it in a clear and simple way :)
Just a tiny detail that I noticed in your code was that you are not really clearing the interval when you click the reset button. That results in a weird interval between the seconds. Try to click the reset button then start the countdown again.
One way to solve that is to in fact clear the interval within the timerReset function.
Instead of clearInterval( () => { this.interval; });
you should have clearInterval(this.interval);
UI/UX Developer working within a range from emails, design and development. Dabbles with Wordpress. Working on React and related technologies at the moment.
Hmm... I'll look into it because that's what I wanted to do (what you said). So if it's not doing that I'm unsure. Otherwise it get incrementally faster and that's now what we want at all. Thanks for pointing it out.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey Tori. Great post! I loved the way you described the steps for achieving the final implementation, you explained it in a clear and simple way :)
Just a tiny detail that I noticed in your code was that you are not really clearing the interval when you click the reset button. That results in a weird interval between the seconds. Try to click the reset button then start the countdown again.
One way to solve that is to in fact clear the interval within the
timerReset
function.Instead of
clearInterval( () => { this.interval; });
you should have
clearInterval(this.interval);
What do you think?
Hmm... I'll look into it because that's what I wanted to do (what you said). So if it's not doing that I'm unsure. Otherwise it get incrementally faster and that's now what we want at all. Thanks for pointing it out.