ms
05/14/2021, 10:07 AMval appsFlow: Flow<List<App>>
get() = appDrawerRepo.allAppsFlow.combine(hiddenAppsRepo.onlyHiddenAppsFlow) { allApps, hiddenApps ->
allApps.minus(hiddenApps)
}.combine(searchFlow) { filteredApps, query ->
when {
query.isNotEmpty() -> filteredApps.filter {
it.name.startsWith(
query,
ignoreCase = true
)
}
else -> filteredApps
}
}
private val searchAppFlow = MutableStateFlow("")
listOf("").asFlow()
natario1
05/14/2021, 1:41 PMephemient
05/14/2021, 1:58 PMms
05/14/2021, 2:53 PMAbhishek Dewan
05/14/2021, 3:03 PMms
05/14/2021, 3:08 PMsearchFlow
if I give listOf("").asFlow()
to combine it works.louiscad
05/14/2021, 11:34 PMephemient
05/14/2021, 11:43 PM.also { println(searchFlow) }
before the .combine(searchFlow) { ... }
ms
05/15/2021, 2:57 AMMutableStateFlow
even though I initialized it.
I'm using Jetpack Compose 1.0.0-beta06louiscad
05/15/2021, 9:21 AMms
05/15/2021, 9:49 AMlouiscad
05/15/2021, 10:03 AMms
05/15/2021, 10:16 AM