koin-android-viewmodel / org.koin.android.viewmodel.ext.android / android.arch.lifecycle.LifecycleOwner

Extensions for android.arch.lifecycle.LifecycleOwner

getViewModel

fun <T : ViewModel> LifecycleOwner.getViewModel(qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): T

Get a viewModel instance

fun <T : ViewModel> LifecycleOwner.getViewModel(clazz: KClass<T>, qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): T

Lazy getByClass a viewModel instance

viewModel

fun <T : ViewModel> LifecycleOwner.viewModel(clazz: KClass<T>, qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): Lazy<T>

Lazy get a viewModel instance

fun <T : ViewModel> LifecycleOwner.viewModel(qualifier: Qualifier? = null, parameters: ParametersDefinition? = null): Lazy<T>

Lazy getByClass a viewModel instance