Change Page.State to sealed interface (#1988)

This commit is contained in:
AwkwardPeak7
2025-04-13 15:32:20 +05:00
committed by GitHub
parent 180318f57d
commit f1e2efcb37
13 changed files with 47 additions and 47 deletions

View File

@ -19,7 +19,7 @@ open class Page(
get() = index + 1
@Transient
private val _statusFlow = MutableStateFlow(State.QUEUE)
private val _statusFlow = MutableStateFlow<State>(State.Queue)
@Transient
val statusFlow = _statusFlow.asStateFlow()
@ -48,11 +48,11 @@ open class Page(
}
}
enum class State {
QUEUE,
LOAD_PAGE,
DOWNLOAD_IMAGE,
READY,
ERROR,
sealed interface State {
data object Queue : State
data object LoadPage : State
data object DownloadImage : State
data object Ready : State
data object Error : State
}
}