Created
November 20, 2019 17:19
-
-
Save elihart/2a6b3865852bc0c68760c69fca06347f to your computer and use it in GitHub Desktop.
MvRx Hello World Example
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 MyState(val text: String = "Hello World") : MvRxState | |
| class MyViewModel(state: MyState) : BaseMvRxViewModel<MyState>(state) | |
| class MyFragment : MvRxFragment() { | |
| val viewModel: MyViewModel by fragmentViewModel() | |
| fun epoxyController() = simpleController(viewModel) { state -> | |
| textRow { | |
| id("title") | |
| text(state.text) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment