I tried init three collects in one coroutines, but worked only first. Only when i set collects in different coroutines its work. Why?
lifecycleScope.launch {
launch {
homeViewModel.dateStateFlow().collect { date ->
date?.let { calendar.text = date.toStringForView() }
}
}
launch {
homeViewModel.toStateFlow().collect { to ->
to?.let { cityTo.text = to.name }
}
}
launch {
homeViewModel.fromStateFlow().collect { from ->
from?.let { cityFrom.text = from.name }
}
}
}