useTimeout
A hook that creates a timeout.
Loading...
Installation
npx shadcn@latest add @shadcnhooks/use-timeoutAPI
/**
* A hook that creates a timeout.
* @param fn - The function to execute after the timeout
* @param delay - The delay in milliseconds before the function is executed
* @returns A function to clear the timeout
*/
export function useTimeout(fn: () => void, delay: number = 0): () => voidCredits
Last updated on