kaven-basic - v6.0.0
    Preparing search index...

    Function Countdown

    • Starts a countdown from the specified number, invoking an optional action at each interval.

      Parameters

      • count: number

        The starting number for the countdown. If less than or equal to 0, resolves immediately with 0.

      • interval: number = 1000

        The interval in milliseconds between each countdown tick. Defaults to 1000ms (1 second). If less than or equal to 0, it is set to 1ms.

      • OptionalintervalAction: (left: number) => boolean | void

        An optional callback invoked at each tick with the current count left. If this callback returns false, the countdown stops early.

      Returns Promise<number>

      A Promise that resolves with the remaining count (usually 0) when the countdown finishes or is stopped early, or rejects if an error occurs in the intervalAction.

      1.1.5

      2025-07-10