Function useCountdown

Creates a countdown timer that will call the onExpiry function when the timer expires.

  • Parameters

    • seconds: number

      The number of seconds to count down.

    • onExpiry: () => void

      The function to call when the timer expires.

    Returns number

    The number of seconds remaining.