Function niceInterval

  • Like setInterval, but debounces catchups (multiple invocation in rapid succession less than our desired interval) that happen in some browsers when tabs wake up from sleep. Cleared with the standard clearInterval.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    • interval: number

    Returns ReturnType<typeof setInterval>