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 Copy
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 }); Copy
Flow.ofTotalTicks(1000, { clampValue: true });
This is a a simple wrapper around relative.
Optional
Readonly
Returns a function that returns the percentage of timer completion. Uses 'ticks' as a measure. Use ofTotal if you want time-based.
Note that timer can exceed 1 (100%). To cap it:
This is a a simple wrapper around relative.