ViewModelComponent
Can be provided as ViewModels or types used by ViewModels when used with @Provides.
@Provides
@ViewModelComponent
class SampleViewModel(
userRepository: UserRepository
): ViewModel()
Content copied to clipboard
Can inject a SavedStateHandle using ViewModelComponent.
@Provides
@ViewModelComponent
class SavedStateViewModel(
private val savedStateHandle: SavedStateHandle
) : ViewModel()
Content copied to clipboard
Additional available types:
kotlinx.coroutines.CoroutineScope with @ViewModelCoroutineScope