UNPKG

@supunlakmal/hooks

Version:

A collection of reusable React hooks

8 lines (7 loc) 323 B
/** * Custom hook for setting a timeout that can be cleared. * * @param {() => void} callback The function to execute after the timeout. * @param {number | null} delay The delay in milliseconds. If null, the timeout is not set. */ export declare const useTimeout: (callback: () => void, delay: number | null) => void;