Options
All
  • Public
  • Public/Protected
  • All
Menu

Module lib/hooks/useInterval

Index

Functions

Functions

  • useInterval(callback: (() => void | Promise<void>), interval: null | number): void
  • A hook that will run a callback function on a given interval. If the interval changes, the existing callback is cancelled and a new one is set up with the new interval.

    Parameters

    • callback: (() => void | Promise<void>)

      The callback to run.

        • (): void | Promise<void>
        • Returns void | Promise<void>

    • interval: null | number

      The interval to run it on. If null it will cancel any existing callback and no longer run.

    Returns void

Generated using TypeDoc