Created
November 20, 2019 20:21
-
-
Save elihart/1b640518b86f75f856da334d8a983771 to your computer and use it in GitHub Desktop.
MvRxViewModelExample
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
| data class TextState(val text: String? = null) : MvRxState | |
| class TextViewModel(state: TextState) : MvRxViewModel<TextState>(state) { | |
| fun setText(text: String) { | |
| setState { | |
| copy(text = text) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment