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(key: String? = null, name: String? = null, parameters: ParameterDefinition = emptyParameterDefinition()): T

Get a viewModel instance

getViewModelByClass

fun <T : ViewModel> LifecycleOwner.getViewModelByClass(clazz: KClass<T>, key: String? = null, name: String? = null, from: ViewModelStoreOwnerDefinition? = null, parameters: ParameterDefinition = emptyParameterDefinition()): T

Get a viewModel instance

viewModel

fun <T : ViewModel> LifecycleOwner.viewModel(key: String? = null, name: String? = null, parameters: ParameterDefinition = emptyParameterDefinition()): Lazy<T>

Lazy getByClass a viewModel instance

viewModelByClass

fun <T : ViewModel> LifecycleOwner.viewModelByClass(clazz: KClass<T>, key: String? = null, name: String? = null, from: ViewModelStoreOwnerDefinition? = null, parameters: ParameterDefinition = emptyParameterDefinition()): Lazy<T>

Lazy getByClass a viewModel instance