Your challenge is to build a timer using React and Redux. This is a pair programming exercise, so pick a partner!
- Display Minutes and Seconds
- Start Button
- Stop Button
- Reset Button
- Style creatively using whatever CSS tools you prefer
- Display milliseconds.
- Create a Lap button that saves the current time and pushes it to an array of laps and displays it.
- Your redux state should contain the current time, defaulted to zero.
- You will need a component to display the time, as well as a separate component which contains the buttons.
- Use the
Dateobject to set minutes and seconds easier. For example:
let time = new Date(0); let secs = time.getSeconds(); // 0 let mins = time.getMinutes(); // 0
clearIntervalmethods will be your best friends.