Function time

Produce values over time. When the modulate is complete, the final value continues to return. Timer starts when return function is first invoked.

const fn = (t) => {
// 't' will be values 0..1 where 1 represents end of time period.
// Return some computed value based on 't'
return t*Math.random();
}
const e = Modulate.time(fn, 1000);

// Keep calling e() to get the current value
e();
  • Parameters

    Returns (() => number)

      • (): number
      • Returns number