NoOpRetainedStateRegistry

A no-op RetainedStateRegistry. Should generally only be used for testing and previews.

Functions

Link copied to clipboard
open override fun consumeValue(key: String): Any?

Returns the restored value for the given key. Once being restored the value is cleared, so you can't restore the same key twice.

Link copied to clipboard
open override fun forgetUnclaimedValues()

Releases all currently unconsumed values. Useful as a GC mechanism for the registry.

Link copied to clipboard

Registers the value provider.

Link copied to clipboard
open override fun saveAll()

Executes all the registered value providers and combines these values into a map. We have a list of values for each key as it is allowed to have multiple providers for the same key.

Link copied to clipboard
open override fun saveValue(key: String)

Executes the value providers registered with the given key, and saves them for retrieval.