| fun loadContent() = quantum.setState { | |
| if (isLoading) { | |
| return@setState this | |
| } | |
| myRepository.loadContent | |
| .onSuccess { | |
| setState { | |
| this@quantum.copy(content = content, error = null) | |
| } | |
| } | |
| .onError { | |
| setState { | |
| copy(error = error) | |
| } | |
| } | |
| .execute() | |
| copy(isLoading = true) | |
| } |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
fun loadContent() = quantum.setState {
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fun loadContent() = quantum.setState {
}