UNPKG

react-use-timer-hook

Version:

A React hook for managing countdown or count-up timers with pause, reset, and customizable callbacks.

19 lines (18 loc) 364 B
export const INITIAL_TIMER_STATE = { time: 0, finishTime: 0, isRunning: false, isPaused: false, totalPauseTime: 0, pauseTime: 0, pauseStart: null, countUp: false }; export const TIMER_ACTIONS = { START: 'START', PAUSE: 'PAUSE', TICK: 'TICK', PAUSE_TICK: 'PAUSE_TICK', RESET: 'RESET', SET_TIME: 'SET_TIME' };