Last active
July 20, 2020 11:12
-
-
Save yasukotelin/1eab5674785c69cb430df4f8d6c672ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@MainThread | |
inline fun <reified VM : ViewModel> Fragment.parentViewModels( | |
noinline ownerProducer: () -> ViewModelStoreOwner = { requireParentFragment() }, | |
noinline factoryProducer: (() -> ViewModelProvider.Factory)? = null | |
) = createViewModelLazy(VM::class, { ownerProducer().viewModelStore }, factoryProducer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment