withPrevious

fun <T> Flow<T>.withPrevious(): Flow<Pair<T?, T>>

Emits each value together with the value that preceded it, null for the first value.

For upstream a, b, c the output is (null, a), (a, b), (b, c).