runningReduce
Reduces the given flow with operation, emitting every intermediate result, including initial value. The first element is taken as initial value for operation accumulator. This operator has a sibling with initial value -- scan.
For example:
flowOf(1, 2, 3, 4).runningReduce { acc, value -> acc + value }.toList()
Content copied to clipboard
will produce [1, 3, 6, 10]