Dashboard sipadu mbip
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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;