Add test for ChangeServerPresenter
This commit is contained in:
parent
41a5d599fa
commit
5ca2b475cc
4 changed files with 146 additions and 1 deletions
|
|
@ -39,7 +39,8 @@ sealed interface Async<out T> {
|
|||
suspend fun <T> (suspend () -> T).execute(state: MutableState<Async<T>>) {
|
||||
try {
|
||||
state.value = Async.Loading()
|
||||
state.value = Async.Success(this())
|
||||
val result = this()
|
||||
state.value = Async.Success(result)
|
||||
} catch (error: Throwable) {
|
||||
state.value = Async.Failure(error)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue