Loading packages/SystemUI/utils/kairos/src/com/android/systemui/kairos/Combinators.kt +0 −10 Original line number Diff line number Diff line Loading @@ -69,16 +69,6 @@ fun <A, B, C> TFlow<A>.samplePromptly( } } /** * Returns a [TState] containing a map with a snapshot of the current state of each [TState] in the * original map. */ fun <K, A> Map<K, TState<A>>.combineValues(): TState<Map<K, A>> = asIterable() .map { (k, state) -> state.map { v -> k to v } } .combine() .map { entries -> entries.toMap() } /** * Returns a cold [Flow] that, when collected, emits from this [TFlow]. [network] is needed to * transactionally connect to / disconnect from the [TFlow] when collection starts/stops. Loading packages/SystemUI/utils/kairos/test/com/android/systemui/kairos/KairosTests.kt +2 −2 Original line number Diff line number Diff line Loading @@ -1170,12 +1170,12 @@ class KairosTests { mergeIncrementally .onEach { println("patch: $it") } .foldMapIncrementally() .flatMap { it.combineValues() } .flatMap { it.combine() } } } } .foldMapIncrementally() .flatMap { it.combineValues() } .flatMap { it.combine() } accState.toStateFlow() } Loading Loading
packages/SystemUI/utils/kairos/src/com/android/systemui/kairos/Combinators.kt +0 −10 Original line number Diff line number Diff line Loading @@ -69,16 +69,6 @@ fun <A, B, C> TFlow<A>.samplePromptly( } } /** * Returns a [TState] containing a map with a snapshot of the current state of each [TState] in the * original map. */ fun <K, A> Map<K, TState<A>>.combineValues(): TState<Map<K, A>> = asIterable() .map { (k, state) -> state.map { v -> k to v } } .combine() .map { entries -> entries.toMap() } /** * Returns a cold [Flow] that, when collected, emits from this [TFlow]. [network] is needed to * transactionally connect to / disconnect from the [TFlow] when collection starts/stops. Loading
packages/SystemUI/utils/kairos/test/com/android/systemui/kairos/KairosTests.kt +2 −2 Original line number Diff line number Diff line Loading @@ -1170,12 +1170,12 @@ class KairosTests { mergeIncrementally .onEach { println("patch: $it") } .foldMapIncrementally() .flatMap { it.combineValues() } .flatMap { it.combine() } } } } .foldMapIncrementally() .flatMap { it.combineValues() } .flatMap { it.combine() } accState.toStateFlow() } Loading