DEV Community

Discussion on: Building a Pomodoro Timer with Vue.js on CodePen

Collapse
 
willamesoares profile image
Will Soares

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?

Collapse
 
teekatwo profile image
Tori Pugh

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.