MvRx makes handling configuration changes manually a thing of the past. By using the property delegate
fragmentViewModel(), MvRx will handle configuration changes for you. No more parceling of data into bundles in onSaveInstanceState!
This lesson will also introduce the concept of invalidate() which will be called any time the state of any of your ViewModels change.
Hello Gabriel, Thanks for this awesome course.
It is very interesting for Fragments. Looks very easy.
About Activities, I found that I need my Activity to extend "BaseMvRxActivity()".
But what about state management? Is there similar delegation to replace this initialization similar to what you did for fragment?
private var viewModel = MainViewModel(MainState())
Thanks a lot.
I think I found something.
I need to replace above line with: private val viewModel: LoginViewModel by activityViewModel()
However, my new issue is, activityViewModel, cannot be imported by Android Studio.