@rooks/use-countdown
Version:
Count down to a target timestamp and call callbacks every second (or provided peried)
16 lines (14 loc) • 377 B
TypeScript
declare type CountdownOptions = {
interval?: number;
onDown?: Function;
onEnd?: Function;
};
/**
*
* useCountdown
* Easy way to countdown until a given endtime in intervals
* @param endTime Time to countdown
* @param options Countdown options
*/
declare function useCountdown(endTime: Date, options?: CountdownOptions): number;
export default useCountdown;