Use Stable interface for Browse screens (#7544)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package eu.kanade.presentation.browse
|
||||
|
||||
import androidx.compose.runtime.derivedStateOf
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import eu.kanade.domain.manga.model.Manga
|
||||
|
||||
interface MigrateMangaState {
|
||||
val isLoading: Boolean
|
||||
val items: List<Manga>
|
||||
val isEmpty: Boolean
|
||||
}
|
||||
|
||||
fun MigrationMangaState(): MigrateMangaState {
|
||||
return MigrateMangaStateImpl()
|
||||
}
|
||||
|
||||
class MigrateMangaStateImpl : MigrateMangaState {
|
||||
override var isLoading: Boolean by mutableStateOf(true)
|
||||
override var items: List<Manga> by mutableStateOf(emptyList())
|
||||
override val isEmpty: Boolean by derivedStateOf { items.isEmpty() }
|
||||
}
|
||||
Reference in New Issue
Block a user