useTimeout.d.ts 287 Bytes
Newer Older
Sangjune Bae's avatar
Sangjune Bae committed
1
2
3
4
5
6
7
8
/**
 * Returns a controller object for setting a timeout that is properly cleaned up
 * once the component unmounts. New timeouts cancel and replace existing ones.
 */
export default function useTimeout(): {
    set: (fn: () => void, delayMs?: number) => void;
    clear: () => void;
};