dimsuz
01/15/2023, 10:16 AMcombine(
conditionFlow1, // Flow<Boolean>
conditionFlow2,
::Pair
)
.flatMapLatest { (cond1, cond2) ->
if (cond1 && cond2) eventSourceFlow.events else emptyFlow()
}
.onEach { event ->
handleEvent(event)
}
.launchIn(scope)
Patrick Steiger
01/15/2023, 1:54 PMtransformLatest
combine(
conditionFlow1, // Flow<Boolean>
conditionFlow2,
::Pair
)
.transformLatest { (cond1, cond2) ->
if (cond1 && cond2) emitAll(eventSourceFlow.events)
}
.onEach { event ->
handleEvent(event)
}
.launchIn(scope)
dimsuz
01/15/2023, 4:44 PM