Skip to main content

UseTimer()

Hooks/useTimer() 타이머를 관리하는 커스텀 훅입니다.

Signature

useTimer: ({
autoStart,
timeLimit,
interval,
setTimeFormat,
onTimeOver,
onTimeUpdate
}?: TimerProps) => {
time: string;
isEnd: boolean;
start: () => void;
restart: () => void;
pause: () => void;
reset: () => void;
}

Parameters

Parameter

Type

Description

{ autoStart, timeLimit, interval, setTimeFormat, onTimeOver, onTimeUpdate}

TimerProps

(Optional)

Returns

{ time: string; isEnd: boolean; start: () => void; restart: () => void; pause: () => void; reset: () => void; }