ViewModelStoreProvider.ReferenceToken


public fun interface ViewModelStoreProvider.ReferenceToken extends 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.

Summary

Inherited methods

From kotlin.AutoCloseable
abstract void