r.0.9.1.source-code.LogRecordRepoExt.kt Maven / Gradle / Ivy
The newest version!
package se.wollan.tolr
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
internal suspend fun LogRecordRepo.listByType(pattern: RecordTypePattern): Flow = flow {
var since: NodeTimestamp = NodeTimestamp.initial
while (true) {
val page = listByTypeLaterThan(pattern, since)
emit(page)
since = page.next ?: break
}
}