Dashboard sipadu mbip
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

useInterval.d.ts 636B

12345678910111213141516
  1. /**
  2. * Creates a `setInterval` that is properly cleaned up when a component unmounted
  3. *
  4. * @param fn an function run on each interval
  5. * @param ms The milliseconds duration of the interval
  6. */
  7. declare function useInterval(fn: () => void, ms: number): void;
  8. /**
  9. * Creates a pasuable `setInterval` that is properly cleaned up when a component unmounted
  10. *
  11. * @param fn an function run on each interval
  12. * @param ms The milliseconds duration of the interval
  13. * @param paused Whether or not the interval is currently running
  14. */
  15. declare function useInterval(fn: () => void, ms: number, paused: boolean): void;
  16. export default useInterval;