pers
04/14/2024, 9:03 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)
}
}
Chris Fillmore
04/14/2024, 10:01 PMpers
04/14/2024, 10:06 PMgildor
04/15/2024, 5:12 AM.flatMapConcat { users ->
flowOf(users.map { fetchInfo(it) })
}
So at least there is no need to explicitly call emit
gildor
04/15/2024, 5:22 AM