Last active
June 26, 2021 09:36
-
-
Save orcchg/7292a3d7f540d3040507361d451f2d22 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class DefaultAuthInteractor @Inject constructor( | |
| private val checkUserRegisteredUseCase: CheckUserRegisteredUseCase, | |
| private val trustedLoginUserUseCase: TrustedLoginUserUseCase | |
| ) : AuthInteractor { | |
| /** | |
| * See how AuthInteractor coordinates the work between use-cases. | |
| */ | |
| override fun login(): Completable = | |
| checkUserRegisteredUseCase.source() | |
| .flatMap { isRegistered -> | |
| if (isRegistered) { | |
| trustedLoginUserUseCase.source { | |
| PARAM_KEY_REG_PIN_CODE of "12345" | |
| } | |
| } else { | |
| // perform registration step via UseCase | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment