I think TT was removed in 7.x what would be the su...
# kodein
m
I think TT was removed in 7.x what would be the substitute ?
r
Sorry for the outdated documentation … you should be able to use
generic()
function from
org.kodein.type
m
generic, and instance have <reified T> and if I understand correctly I cannot use override for Factory with reified type
I think I could do
Copy code
class DIViewModelFactory(
    val di: DI
) : ViewModelProvider.Factory {
    override inline fun <T : ViewModel> create(modelClass: Class<T>): T =
        di.direct.instance<ViewModel>(tag = modelClass.simpleName) as T

}
but now I need to understand how to add tags to viewmodel classes
r
If you don’t want the type to be reified, and thus erased if binding generics, you can you the functions
erased
/
erasedOf