RetainedValuesStoreOwner

Owns the retained-value stores used by RetainedValuesStoreProvider to preserve values across composition recreation.

The owner must outlive every composition that should share retained values. Call dispose when that lifetime permanently ends. Values are held in memory and do not survive process death. This class is not thread-safe. Calls to it and callbacks from its leases must be serialized.

Providers that share an owner use positional identity. Providers at the same position are matched in acquisition order when recreated. Matching requires the previous composition to be disposed before its replacement composes, so a provider that overlaps its predecessor receives a new empty store. Use a separate owner for independently recreated roots whose order can change.

Stores keep their values until dispose, including when their provider permanently leaves the composition.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun dispose()

Permanently releases every retained value held by this owner.