ildar.i [Android]
04/29/2022, 8:18 AMfirstFlow.combine(secondFlow) { text: String, role: Role ->
repository.getProcessList(role.apiParam, text)//returns new flow each time
}.flatMapLatest {
it
}myanmarking
04/29/2022, 8:27 AMmyanmarking
04/29/2022, 8:28 AMfirstFlow.combine(secondFlow) { text: String, role: Role -> role.apiParam to text }
.flatMapLatest { (apiParam, text) ->
repository.getProcessList(apiParam, text)
}ildar.i [Android]
04/29/2022, 8:33 AMjulian
04/29/2022, 5:18 PMcombineLatest operator, and use it followed by flatten. combineLatest would combine the latest emissions of the source flows and switch to the latest flow returned by its suspend lambda parameter blob shrug.