useCountdown
Implements countdown functionality with configurable options.
useCountdown
Installation
Usage
API
useCountdown
Parameters
| Name | Type | Description |
|---|---|---|
| countStart | number | The countdown's initial value. |
| countStop | number | The value at which the countdown ends (default is 0). |
| intervalMs | number | The time in milliseconds between countdown updates (default is 1000). |
Returns
| Name | Type | Description |
|---|---|---|
| count | number | The current countdown value. |
| startCountdown | () => void | A function to begin the countdown. |
| stopCountdown | () => void | A function to pause the countdown. |
| resetCountdown | () => void | A function to reset the countdown to the initial starting value. |