useCountdown
Custom hook that manages countdown.
Installation
npx sse-hooks add use-countdown
yarn dlx sse-hooks add use-countdown
pnpm dlx sse-hooks add use-countdown
deno run -A npm:sse-hooks add use-countdown
bunx sse-hooks add use-countdown
Usage
example.ts
import { useCountdown } from "./{hooks file}";
const [counter, { start, stop, reset }] = useCountdown({
countStart: 10,
intervalMs: 1000,
isIncrement: false,
});
API
Parameters
| Prop | Default | Type |
|---|---|---|
countdownOptions | - |
The countdown's options.
|
Returns
| Return Value | Default | Type |
|---|---|---|
[0] | - |
|
[1] | - |
|
Types Aliases
No specific type aliases defined for this component.