Function ticks

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

If you need to check if a modulator is done or reset it, consider tickModulator.

const fn = (t) => {
// 't' will be values 0..1 representing elapsed ticks toward totwal
}
const e = ticks(fn, 100);

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

    • fn: Modulate

      Function that produces 0..1 scale

    • totalTicks: number

      Total length of ticks

    Returns (() => number)

      • (): number
      • Returns number