Skip to content

Instantly share code, notes, and snippets.

@knirb
Created August 16, 2021 15:19
Show Gist options
  • Save knirb/028e910c5b61718a4f0fbcfe5161c79d to your computer and use it in GitHub Desktop.
Save knirb/028e910c5b61718a4f0fbcfe5161c79d to your computer and use it in GitHub Desktop.
const length = 10 * 1000 * 60;
const App: React.FC = () => {
const timer = useTimer({ length });
return (
<div className="App">
<h2>{timer.value}</h2>
<div>
<Button onClick={timer.start}>Start</Button>
<Button onClick={timer.stop}>Stop</Button>
<Button onClick={timer.skip}>Skip</Button>
<Button onClick={timer.reset}>Reset</Button>
</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment