UNPKG

@rbxts/pretty-react-hooks

Version:
10 lines (9 loc) 422 B
/** * Sets a timeout that runs the callback function after `delay` seconds. If * `delay` is `undefined`, the timeout is cleared. If the delay changes, the * timeout is reset. * @param callback The callback function to run. * @param delay The delay in seconds before the timeout. * @returns A function that clears the timeout. */ export declare function useTimeout(callback: () => void, delay?: number): () => void;