Open
Description
public suspend fun <T1, T2> combineAndCollect(
flow1: Flow<T1>,
flow2: Flow<T2>,
collector: suspend (a: T1, b: T2) -> Unit,
)
Example
class MyActivity : AppCompatActivity() {
fun onCreate(...) {
lifecycleScope.launch {
repeatOnLifecycle {
combineAndCollect(viewModel.uiStateFlow, xxxStateFlow) { uiState, xxx -> renderUi(uiState, xxx) }
}
}
}
}