Closed Zhuinden closed 3 years ago
Not really needed, and SavedStateHandle's savedStateProvider is package-internal, it would need integration with a SavedStateRegistry too.
Technically there is no reason to integrate at this time that I know of. But it wouldn't be too hard if a real usecase came up.
But it won't be in these samples as there's no reason to.
Due to the way
ktx
adds new concepts like theviewModelScope
, it would make sense to show how to use ScopedServices to create a scoped service per screen (or shared) that holds aViewModelStore
, implementsViewModelStoreOwner
, issuesonCleared()
inonServiceUnregistered()
and therefore basically shows how to combine ViewModel with ScopedServices.