InMemoryRecentCountryStore

class InMemoryRecentCountryStore(initial: List<String> = emptyList(), maxEntries: Int = DefaultRecentCountryStore.DEFAULT_MAX_ENTRIES) : RecentCountryStore(source)

An in-memory RecentCountryStore that survives recomposition but not process death.

Useful for previews, tests, and hosts that want the recents section without persisting anything.

Constructors

Link copied to clipboard
constructor(initial: List<String> = emptyList(), maxEntries: Int = DefaultRecentCountryStore.DEFAULT_MAX_ENTRIES)

Functions

Link copied to clipboard
open suspend override fun clear()

Forgets everything. Wire this to the host's "clear data" affordance.

Link copied to clipboard
open override fun observeRecentCountryCodes(): Flow<List<String>>

Emits the recent ISO alpha-2 codes, most recent first, whenever they change.

Link copied to clipboard
open suspend override fun recordSelection(countryCode: String)

Records that the user selected countryCode, moving it to the front.