I am also working with arch components, I dont thi...
# koin
a
I am also working with arch components, I dont think that injecting the viewmodel that survives configuration changes (the one that is initialized via ViewModelProviders.of) is a good idea. Instead you should create it yourself and provide it in your module. But if you want to do the lifecycle viewmodel you can use this handy extension function i wrote
inline fun <reified T: ViewModel> Fragment.getVM() = ViewModelProviders.of(this).get(T::class.java)
or lazy version
inline fun <reified T: ViewModel> Fragment.lazyVM() = lazy { getVM<T>() }