How to use constructor injection for android ViewModels with Toothpick

217 views Asked by At

I want to use constructor injection for my view models

@InjectConstructor
class SomeViewModel(private val dependency: SomeDependency) : ViewModel() { ... }

It seems possible with custom view model factory subScope.installViewModelBinding<VM>(fragment, factory) but I haven't figured out yet how can I do it in convenient way, any suggestions?

0

There are 0 answers