Installation
npx sse-hooks add use-interval
yarn dlx sse-hooks add use-interval
pnpm dlx sse-hooks add use-interval
deno run -A npm:sse-hooks add use-interval
bunx sse-hooks add use-interval
Usage
example.ts
import { useInterval } from "./{hooks file}";
const handleInterval = () => {
// Code to be executed at each interval
};
useInterval(handleInterval, 1000);
API
Parameters
| Prop | Default | Type |
|---|---|---|
callback | - |
The function to be invoked at each interval. |
delay | - |
The time, in milliseconds, between each invocation of the callback. Use |
Returns
| Return Value | Default | Type |
|---|---|---|
return | - |
Hook return value |
Types Aliases
No specific type aliases defined for this component.