Last active
May 16, 2024 12:34
-
-
Save MkhytarMkhoian/4bef56912dcbc4794c2449bf10b1a8b4 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
private fun fetchFares() = intent { | |
reduce { state.copy(status = ScreenContentStatus.Loading) } | |
executeUseCase { getFaresByIdUseCase(ryderId).asPresentation() } | |
.onSuccess { fares -> | |
reduce { | |
state.copy( | |
status = ScreenContentStatus.Success, | |
fares = fares | |
) | |
} | |
} | |
.onFailure { | |
reduce { state.copy(status = ScreenContentStatus.Failure) } | |
postSideEffect(FareListEffect.ShowGeneralNetworkError) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment