RetainedValuesStoreProvider

Installs a retained-values store that survives composition recreation for the lifetime of its owner.

If owner is omitted, this uses the current lifecycle ViewModel owner on platforms that provide one. Other platforms require an explicit owner. An already installed non-forgetful retained values store always takes precedence, allowing a platform or application store to control the lifetime instead.

This provides in-memory retention only. It does not restore values after process death. Values are kept for the full lifetime of owner, even while their provider is out of the composition. Independently recreated roots whose order can change should each receive an explicit owner instead of sharing one automatic owner.

Throws

if no explicit or platform owner is available, or if owner has already been disposed.