reduceIndexed method

Bloom<E> reduceIndexed(
  1. E combine(
    1. int index,
    2. E previous,
    3. E element
    )
)

Reduces this collection to a single value by iteratively combining elements along with their index reactively.

  • combine: Indexed reducer function combining the accumulator and current element.

Requires:

  • The collection must not be empty when evaluated.

Throws:

  • StateError if the collection is empty upon evaluation.

Implementation

Bloom<E> reduceIndexed(
        E Function(int index, E previous, E element) combine) =>
    computed((via) => via(bloom).reduceIndexed(combine));