Created
January 29, 2018 23:48
-
-
Save enricopolanski/f9a7e320b4dd7949f783e7a418c31b63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let timer = 1500; | |
let startTimer = function(){ | |
if (timer !== 0){ | |
timer -= 1; | |
timerToTime(); | |
} else{ | |
timer = 1500; | |
window.clearTimeout(timeoutID); | |
} | |
} | |
let timeoutID = window.setTimeout(startTimer, 1000); | |
pomodoroStartButton.onclick = function(){ | |
startTimer(); | |
} | |
pomodoroStopButton.onclick = function(){ | |
window.clearTimeout(timeoutID); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment