UNPKG

qol-hooks

Version:

A collection of React hooks to improve the quality of life of developers.

12 lines (11 loc) 466 B
/** * @description A hook to call a function at a specified interval * @param {() => void} callback The function to call at the specified interval * @param {number | null | undefined} delay The delay in milliseconds * * @example```tsx * useInterval(() => console.log("Hello, World!"), 1000); // Logs "Hello, World!" every second * ``` */ declare function useInterval(callback: () => void, delay: number | null | undefined): void; export default useInterval;