Returns a function that returns the percentage of timer completion. Starts when return function is first invoked.
import * as Flow from "https://unpkg.com/ixfx/dist/flow.js"const timer = Flow.ofTotal(1000);// Call timer() to find out the completiontimer(); // Returns 0..1 Copy
import * as Flow from "https://unpkg.com/ixfx/dist/flow.js"const timer = Flow.ofTotal(1000);// Call timer() to find out the completiontimer(); // Returns 0..1
Note that timer can exceed 1 (100%). To cap it:
Flow.ofTotal(1000, { clampValue: true }); Copy
Flow.ofTotal(1000, { clampValue: true });
Takes an Interval for more expressive time:
const timer = Flow.ofTotal({ mins: 4 }); Copy
const timer = Flow.ofTotal({ mins: 4 });
Is a simple wrapper around relative.
Optional
Readonly
Returns a function that returns the percentage of timer completion. Starts when return function is first invoked.
Note that timer can exceed 1 (100%). To cap it:
Takes an Interval for more expressive time:
Is a simple wrapper around relative.