Closed GeorgCantor closed 1 month ago
It's not compiling
> Task :ai:sample:core:compileDebugKotlin FAILED
e: file:///home/runner/work/horologist/horologist/ai/sample/core/src/main/java/com/google/android/horologist/ai/core/registry/CombinedInferenceServiceRegistry.kt:27:27 Unresolved reference 'asFlow'.
e: file:///home/runner/work/horologist/horologist/ai/sample/core/src/main/java/com/google/android/horologist/ai/core/registry/CombinedInferenceServiceRegistry.kt:28:30 Cannot infer type for this parameter. Please specify it explicitly.
e: file:///home/runner/work/horologist/horologist/ai/sample/core/src/main/java/com/google/android/horologist/ai/core/registry/CombinedInferenceServiceRegistry.kt:28:51 Unresolved reference 'models'.
e: file:///home/runner/work/horologist/horologist/ai/sample/core/src/main/java/com/google/android/horologist/ai/core/registry/CombinedInferenceServiceRegistry.kt:30:14 Unresolved reference 'asFlow'.
But generally the new logic seems different anyway.
WHAT
Use flatMap for Combining Flows: Instead of using combine and then flattening the result, we can use flatMapConcat, which is more efficient for this use case.
WHY
Performance Improvement: Using flatMapConcat is generally more efficient than combining and flattening lists afterward.
HOW
Checklist :clipboard: