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

If you need to check if an easing is done or reset it, consider tickEasing.

import { Easings } from "https://unpkg.com/ixfx/dist/modulation.js";
// Quad-in easing over 100 ticks
const e = Easings.ticks(`quadIn`, 100);

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

This is just a wrapper around Modulator.ticks

  • Parameters

    • nameOrFunction:
          | "bounceOut"
          | "quintIn"
          | "quintOut"
          | "arch"
          | "smoothstep"
          | "smootherstep"
          | "sineIn"
          | "sineOut"
          | "quadIn"
          | "quadOut"
          | "sineInOut"
          | "quadInOut"
          | "cubicIn"
          | "cubicOut"
          | "quartIn"
          | "quartOut"
          | "expoIn"
          | "expoOut"
          | "quintInOut"
          | "expoInOut"
          | "circIn"
          | "circOut"
          | "backIn"
          | "backOut"
          | "circInOut"
          | "backInOut"
          | "elasticIn"
          | "elasticOut"
          | "bounceIn"
          | "bell"
          | "elasticInOut"
          | "bounceInOut"
          | ((v: number) => number)

      Easing name or a function that produces 0..1 scale

    • totalTicks: number

      Total length of ticks

    Returns (() => number)

      • (): number
      • Returns number