Kotlin Flow - custom result retry Maybe I will write article about this API: internal fun <T, R> Flow<T>.retryMap( map: suspend (T) -> R, predicate: suspend FlowCollector<R>.(value: T, result: R, attempt: Int) -> Boolean ): Flow<R> { var retryCount = 1