Created
May 30, 2017 16:06
-
-
Save maciekczwa/4e0228058a92e0f7b401897d1456105a 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
BASE | |
inline fun <reified T : ViewModel> createViewModel() = ViewModelProviders.of(this, viewModelFactory).get(T::class.java) | |
IMPL | |
val searchViewModel: SearchViewModel by lazy { createViewModel<SearchViewModel>() } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment