ViewModelStoreProvider.ReferenceToken
-
Cmn
fun interface ViewModelStoreProvider.ReferenceToken : AutoCloseable
Represents an active hold on a specific ViewModelStore.
As long as this token remains active, the underlying ViewModels will survive calls to clearKey or clearAllKeys. This allows them to safely outlive their immediate UI (e.g., during exit animations).
Calling close releases this hold and decrements the reference count for the store. If the store has been marked for removal and this was the last active reference, the store will be immediately cleared.