Last active
March 20, 2020 16:34
-
-
Save seoft/83ac615a54d9e825c76cde20d720a4fa 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
// in koin module | |
val viewModelModule = module { | |
viewModel { MainViewModel() } | |
} | |
// in activity | |
val mainViewModel by viewModel<MainViewModel>() | |
// in fragment created from activity | |
val mainViewModel by sharedViewModel<MainViewModel>() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment