Created
February 10, 2020 00:44
-
-
Save OssamaDroid/61fdfc9dd7bbad64640d53133cd0dc7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
results.scan(UIModel.idle(), { _, result -> | |
when (result) { | |
SubmitResult.InFlight, CheckNameResult.InFlight -> UIModel.inProgress() | |
SubmitResult.Success, CheckNameResult.Success -> UIModel.success() | |
is SubmitResult.Failure -> UIModel.error(result.errorMessage) | |
is CheckNameResult.Failure -> UIModel.error(result.errorMessage) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment