Skip to content

ImmutableRollingAverage

Defined in: math/fp/rolling-average.ts:12

A simple implementation of a rolling average calculator that maintains a fixed-size window of the most recent values.

See

  • SimpleRollingAverage for a mutable version of the rolling average calculator.
  • addValue to clone and add values to ImmutableRollingAverage instances.
  • getAverage to calculate the average of the current values in the rolling average window.

Properties

maxSize

maxSize: number

Defined in: math/fp/rolling-average.ts:14


values

values: number[]

Defined in: math/fp/rolling-average.ts:13