Function ofTotalTicks

  • Returns a function that returns the percentage of timer completion. Uses 'ticks' as a measure. Use ofTotal if you want time-based.

    import * as Flow from "https://unpkg.com/ixfx/dist/flow.js"
    const timer = Flow.ofTotalTicks(1000);
    timer(); // Returns 0..1

    Note that timer can exceed 1 (100%). To cap it:

    Flow.ofTotalTicks(1000, { clampValue: true });
    

    This is a a simple wrapper around relative.

    Parameters

    • totalTicks: number
    • opts: {
          clampValue?: boolean;
          wrapValue?: boolean;
      } = {}
      • Optional ReadonlyclampValue?: boolean
      • Optional ReadonlywrapValue?: boolean

    Returns (() => number)

      • (): number
      • Returns number