koin icon indicating copy to clipboard operation
koin copied to clipboard

Add viewmodel get key to koin, and add KoinViewModelLazy class

Open allen-hsu opened this issue 2 years ago • 0 comments

Hi, because the ViewModel provider has the function (ViewModelProvider.get(key, clazz)) that can let you pass the key to ViewModel provide in order to get a different ViewModel with a different key, I want to raise this PR, and according to this : https://github.com/InsertKoinIO/koin/issues/213

Originally I was going to change ViewModelProvider.resolveInstance, but I found that the new version of koin uses ViewModelLazy instead, but it is an Android lib, so I tried to build a KoinViewModelLazy, please consider this scenario carefully, I believe that I am not the only one who needs to pass in the key

allen-hsu avatar Jun 29 '22 06:06 allen-hsu