ViewModelComponent

annotation class ViewModelComponent

Can be provided as ViewModels or types used by ViewModels when used with @Provides.

@Provides
@ViewModelComponent
class SampleViewModel(
userRepository: UserRepository
): ViewModel()

Can inject a SavedStateHandle using ViewModelComponent.

@Provides
@ViewModelComponent
class SavedStateViewModel(
private val savedStateHandle: SavedStateHandle
) : ViewModel()

Additional available types: