mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-25 23:03:36 +01:00
9 lines
287 B
TypeScript
9 lines
287 B
TypeScript
/**
|
|
* 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;
|
|
};
|