@mr.karakus/hooks.use-countdown
v0.0.1
Published
Countdown hook
Downloads
16
Readme
@mr.karakus/hooks.useCountdown
Installation
yarn add @mr.karakus/hooks.use-countdown
npm i @mr.karakus/hooks.use-countdown
pnpm i @mr.karakus/hooks.use-countdown
Usage
import {useCountdown} from "@mr.karakus/hooks.use-countdown"
....
// example 5 minute
const dt = new Date();
dt.setMinutes(dt.getMinutes() + 5);
....
const { count } = useCountdown({ finishDate: dt });
...
return <p>{`Remaining Time: ${count}`} // 05:00 ... 04.59 ... 04.58...
License
MIT