countdownFlow

fun countdownFlow(from: Int, interval: Duration): Flow<Int>

Returns a flow that counts down from from to 0, one number every interval.

from is emitted immediately on collection, each subsequent number after interval, and the flow completes after emitting 0.

Throws

if from is negative or interval is not positive.