Function useIntervalCallback

  • Invokes a callback periodically while the component is mounted.

    All functions that were scheduled with the same delay are invoked synchronously across all components that use this hook.

    Type Parameters

    • A extends any[]

      The callback arguments.

    Parameters

    • cb: ((...args) => void)

      The callback to invoke.

        • (...args): void
        • Parameters

          • Rest ...args: A

          Returns void

    • ms: number

      The delay after which the callback must be invoked.

    • Rest ...args: A

      Varargs that are passed as arguments to the callback.

    Returns void