andev
06/12/2020, 6:15 PM@JvmOverloads
fun <T : Any> Flow<Query<T>>.mapToOne(
context: CoroutineContext = Dispatchers.Default
): Flow<T> = map {
withContext(context) {
it.executeAsOne()
}
}
wouldn't it be more idiomatic to use flowOn
instead of withContext
?