Replace PageLoader.getPage() with PageLoader.loadPage() (#8976)

* Follow page status via StateFlow

Keep getPage subscription since it's needed to load the pages

* Replace PageLoader.getPage with PageLoader.loadPage
This commit is contained in:
Two-Ai
2023-01-23 17:10:44 -05:00
committed by GitHub
parent 1a319601de
commit 2ef1f07aae
10 changed files with 83 additions and 92 deletions

View File

@ -20,10 +20,14 @@ open class Page(
get() = index + 1
@Transient
@Volatile
var status: State = State.QUEUE
private val _statusFlow = MutableStateFlow(State.QUEUE)
@Transient
val statusFlow = _statusFlow.asStateFlow()
var status: State
get() = _statusFlow.value
set(value) {
field = value
_statusFlow.value = value
statusSubject?.onNext(value)
}