Last active
December 4, 2020 17:16
-
-
Save adevone/5dee7128b2a809e6109a9a0ea3d6795e 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
interface LoginByPhoneView { | |
var viewState: LoginByPhoneState | |
} | |
enum class LoginByPhoneState { | |
Request, | |
Confirm | |
} | |
class LoginByPhonePresenter : SummerViewModel<LoginByPhoneView>() { | |
override val viewProxy = object : LoginByPhoneView { | |
override var viewState by state({ it::viewState }, initial = LoginByPhoneState.Request) | |
} | |
fun onRequestCodeClick() { | |
launch { | |
val code = requestCodeRepository.execute() | |
viewProxy.viewState = LoginByPhoneState.Confirm | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment