Skip to main content

Interface: UseCooldownReturn

Defined in: use-cooldown.ts:14

Value returned by useCooldown.

Properties​

isActive​

isActive: boolean

Defined in: use-cooldown.ts:18

true while a countdown is running (remaining > 0).


remaining​

remaining: number

Defined in: use-cooldown.ts:16

Whole seconds left. 0 when idle.


reset​

reset: () => void

Defined in: use-cooldown.ts:25

Stop the countdown and set remaining back to 0, without onComplete.

Returns​

void


start​

start: (seconds?) => void

Defined in: use-cooldown.ts:23

Begin a fresh countdown from seconds, restarting it if one is already running. Pass a number to override the hook's seconds for this run only.

Parameters​

seconds?​

number

Returns​

void