Skip to main content

useInterval

Callable

  • useInterval(callback: () => void, ms: number): void

  • A custom hook that invokes a callback function at a specified interval.


    Parameters

    • callback: () => void

      The function to be invoked at the specified interval.

    • ms: number

      The time (in milliseconds) between each invocation of the callback function.

    Returns void