rax-use-countdown
A countdown hooks which will return the left days/hours/minutes/seconds state.
Install
$ npm install rax-use-countdown --save
API
The API will recevie two params -- start/end.
| start | number | Start time |
| ent | number | End time |
Example
import { createElement } from 'rax';
import useCountDown from 'rax-use-countdown';
function Example() {
const now = Date.now();
const { days, hours, minutes, seconds } = useCountDown(now, now - 10000000);
return <div>There only left {days}days {hours}hours {minutes}minutes {seconds}seconds</div>;
}