groupFoldBy<K, G> method

Bloom<Map<K, G>> groupFoldBy<K, G>({
  1. required K key(
    1. E element
    ),
  2. required G fold(
    1. G? previous,
    2. E element
    ),
})

Groups and folds elements by a key computed from each element reactively.

  • key: Function extracting the grouping key from each element.
  • fold: Function combining the previous group value (or null) with the current element.

Implementation

Bloom<Map<K, G>> groupFoldBy<K, G>({
  required K Function(E element) key,
  required G Function(G? previous, E element) fold,
}) =>
    computed((via) =>
        Map<K, G>.unmodifiable(via(bloom).groupFoldBy<K, G>(key, fold)));