ixfx
    Preparing search index...

    Function trackNumberChange

    • Returns a function to monitor value changes.

      const f = trackNumberChange(true);
      f(10); // { changed: true, changesCount: 1 }
      f(10); // { changed: false, changesCount: 1 }

      Default options:

      • nanHandling: error
      • includeFirstValueInCount: false

      NaN handling:

      • allow: use NaN value as a legal value and report a change
      • skip: ignore NaN values, reporting back no change and use the same changes count
      • error: throw an error if a NaN value is received

      Parameters

      Returns (v: number) => TrackChangeResult