Skip to content

kevinchappell/timer-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Timer Challenge

Create a countdown timer with start/stop and reset buttons.

image

Objectives

Fill in the methods for the Timer class found in src/timer.js. Fill in the onReset and onComplete functions in src/index.js. Add toggle functionality to the click event handler for the start/pause button in src/index.js.

Timer should:

  • count down to 0 and stop.
  • be able to pause and resume.
    • Timer should stop counting down when paused
    • Timer should continue counting from paused time when resumed.
  • be able to reset
    • when reset, the timer returns to it's initial start time.

Completion time: 1 - 2 hours

Getting Started

You can use Codesandbox or github to complete the challenge online or locally. Once you've completed the challenge, submit your work by sharing a link to your fork.

Codesandbox

Fork https://codesandbox.io/s/github/kevinchappell/timer-challenge

Local

Fork or clone this repo directly then run:

npm install
npm start

This will install its dependencies and start the development server. From there you can edit the files in src/ until the objectives are completed.

Bonus

Describe testing strategy for the Timer class.

Super Bonus

Add tests for the Timer class.