Skip to main content

useCountdown

The useCountdown is a custom hook for countdown capability.

github
View source code
import { useCountdown } from '@uhg-abyss/web/hooks/useCountdown';

Callback function​

You can specify a callback function that will be executed every time the countdown reaches zero.

Reset countdown time​

Use the resetCountdown function returned by the hook to reset the countdown back to its starting value.

Set countdown time​

Use the setCountdownTime function returned by the hook to set the countdown to a new time.

Output​

Table of Contents