Function pushUpdate

  • Adds an item to the array or replaces the last item in the array. If the array limit size is exceeded, the oldest array element will be removed and returned by the function.

    Type Parameters

    • T

    Parameters

    • array: T[]
    • replace: boolean
    • item: T
    • maxLength: number

    Returns undefined | null | T