koin-android-viewmodel / org.koin.android.viewmodel.ext.android / android.support.v4.app.Fragment

Extensions for android.support.v4.app.Fragment

getSharedViewModel

fun <T : ViewModel> Fragment.getSharedViewModel(qualifier: Qualifier? = null, scope: Scope = Scope.GLOBAL, from: ViewModelStoreOwnerDefinition = { activity as ViewModelStoreOwner }, parameters: ParametersDefinition? = null): T

Get a shared viewModel instance from underlying Activity

sharedViewModel

fun <T : ViewModel> Fragment.sharedViewModel(qualifier: Qualifier? = null, scope: Scope = Scope.GLOBAL, from: ViewModelStoreOwnerDefinition = { activity as ViewModelStoreOwner }, parameters: ParametersDefinition? = null): Lazy<T>

Lazy getByClass a viewModel instance shared with Activity