ixfx
    Preparing search index...

    Function timerWithFunction

    • Wraps timer, computing a value based on its elapsed value. fn creates this value.

      const t = timerWithFunction(v=>v/2, relativeTimer(1000));
      t.compute();

      In the above case, relativeTimer(1000) creates a timer that goes from 0..1 over one second. fn will divide that value by 2, so t.compute() will yield values 0..0.5.

      Parameters

      Returns HasCompletion & Timer & { get isDone(): boolean } & { compute: () => number }

      • getisDone():boolean

        Returns true if this timer has completed.

      • compute: () => number