mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-26 11:07:51 +02:00
Fix loading screen not appearing when changing query in browser screen
Fixes #1438 Closes #1441
This commit is contained in:
@ -42,5 +42,7 @@ dependencies {
|
||||
implementation(compose.ui.tooling.preview)
|
||||
implementation(compose.ui.util)
|
||||
|
||||
implementation(androidx.paging.runtime)
|
||||
implementation(androidx.paging.compose)
|
||||
implementation(kotlinx.immutables)
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
package mihon.presentation.core.util
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.paging.PagingData
|
||||
import androidx.paging.compose.LazyPagingItems
|
||||
import androidx.paging.compose.collectAsLazyPagingItems
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
@Composable
|
||||
fun <T: Any> StateFlow<Flow<PagingData<T>>>.collectAsLazyPagingItems(): LazyPagingItems<T> {
|
||||
val flow by collectAsState()
|
||||
return flow.collectAsLazyPagingItems()
|
||||
}
|
Reference in New Issue
Block a user