pers
04/14/2024, 3:01 PMfun loadUsersByRegion(regions: List<String>): Flow<List<User>>
I want to call fetchInfo on each item without nesting map....
fun fetchInfo(user: User): Info
is there any better?
.flatMapConcat { users ->
flow {
val usersInfo = users.map { user -> fetchInfo(user) }
emit(usersInfo)
}
}
CLOVIS
04/15/2024, 7:48 AMloadUserByRegion
return a Flow<List<User>>
instead of a Flow<User>
?pers
04/15/2024, 7:49 AMCLOVIS
04/15/2024, 7:52 AMloadUsersByRegaion(…)
.flatMapConcat { it.asFlow() }
.map { fetchInfo(it) }