fold

inline suspend fun <T, R> Flow<T>.fold(initial: R, crossinline operation: suspend (R, T) -> R): R

Accumulates value starting with initial value and applying operation current accumulator value and each element

Sources

common source
Link copied to clipboard