Function reduceWhile

  • 🦴 utilities

    reduce() with predicate for early termination. A simple version of the same function in the ramda package.

    Type Parameters

    • T

    • R

    Parameters

    • predicate: ((acc, currentValue) => boolean)
        • (acc, currentValue): boolean
        • Parameters

          • acc: R
          • currentValue: T

          Returns boolean

    • callbackfn: ((previousValue, currentValue, currentIndex, array) => R)
        • (previousValue, currentValue, currentIndex, array): R
        • Parameters

          • previousValue: R
          • currentValue: T
          • currentIndex: number
          • array: T[]

          Returns R

    • initialValue: R
    • array: T[]

    Returns R

Generated using TypeDoc