ixfx
    Preparing search index...

    Type Alias MovingWindowOptions<T>

    type MovingWindowOptions<T> = {
        allow?: (value: T) => boolean;
        reject?: (value: T) => boolean;
        samples: number;
    }

    Type Parameters

    • T
    Index

    Properties

    allow?: (value: T) => boolean

    If specified, this function is called to filter values before they are added to the window. If the allow function returns true, the value IS added.

    If 'reject' is also specified and it returns true, the allow function will not override it.

    Type declaration

      • (value: T): boolean
      • Parameters

        • value: T

        Returns boolean

    reject?: (value: T) => boolean

    If specified, this function is called to filter values before they are added to the window. If the reject function returns true, the value is NOT added.

    If the 'allow' function is also specified, it only gets used if 'reject' returns false.

    Type declaration

      • (value: T): boolean
      • Parameters

        • value: T

        Returns boolean

    samples: number

    How many values to keep