Room : continue improving members loading

This commit is contained in:
ganfra 2023-04-21 14:39:47 +02:00
parent f02ee307cc
commit b0152059ff
26 changed files with 329 additions and 166 deletions

View file

@ -47,7 +47,9 @@ suspend fun <T> (suspend () -> T).execute(state: MutableState<Async<T>>, errorMa
}
suspend fun <T> (suspend () -> Result<T>).executeResult(state: MutableState<Async<T>>) {
state.value = Async.Loading()
if (state.value !is Async.Success) {
state.value = Async.Loading()
}
this().fold(
onSuccess = {
state.value = Async.Success(it)