You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

9 lines
287 B

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