RecentCountryStore

Persists the countries a user has recently chosen, so the sheet can offer them first.

Only ISO alpha-2 codes cross this boundary — never search queries, and never anything else the user typed. Recording a country the user picked is a preference; recording what they searched for is tracking, and this interface makes the former impossible to confuse with the latter.

Hosts that must not persist anything (kiosk, guest, incognito modes) pass NoOpRecentCountryStore or set showRecentlySelected = false in the config.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun clear()

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

Link copied to clipboard

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

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

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