koin-android-architecture / org.koin.android.architecture.ext / android.arch.lifecycle.LifecycleOwner / viewModel
viewModel
inline fun <reified T : ViewModel> LifecycleOwner.viewModel(key: String? = null, name: String? = null): Lazy<T>
Lazy get a viewModel instance
Parameters
key -
- ViewModel Factory key (if have several instances from same ViewModel)
name -
- Koin BeanDefinition name (if have several ViewModel definition of the same type)
inline fun <reified T : ViewModel> LifecycleOwner.viewModel(key: String? = null, name: String? = null, noinline parameters: Parameters): Lazy<T>
Lazy get a viewModel instance
Parameters
key -
- ViewModel Factory key (if have several instances from same ViewModel)
name -
- Koin BeanDefinition name (if have several ViewModel definition of the same type)
parameters -
- parameters to pass to the BeanDefinition