ixfx
    Preparing search index...

    Function ofTotalTicks

    • Returns a function that returns the percentage (0..1) 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 } = {}

      Returns () => number