Last active
October 25, 2022 20:05
-
-
Save mcatta/084f837cfeac27ffb7e90b7870f7f28f 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
inState<GithubState.Load> { | |
onEnter { state: State<GithubState.Load> -> | |
val owner = state.snapshot.owner | |
githubRepository.repositoryByOwner(owner = owner).fold( | |
ifLeft = { | |
GithubState.Error(Throwable("Fail"), owner = owner) | |
}, | |
ifRight = { | |
GithubState.ContentState(repositories = it, owner = owner) | |
} | |
).let { state.override { it } } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment