was going to do some custom impl but decided to just keep it simple for fear of buggy mess.
inline fun <T1, T2, T3, R> combineFlatLatest(
one: Flow<T1>,
two: Flow<T2>,
three: Flow<T3>,
crossinline combiner: (T1, T2, T3) -> Flow<R>
): Flow<R> {
return combine(one, two, three) { _one, _two, _three ->
arrayOf(_one, _two, _three)
}.flatMapLatest { elements ->
@Suppress("UNCHECKED_CAST")
combiner(
elements[0] as T1,
elements[1] as T2,
elements[2] as T3
)
}
}