SettingsTopicPreferencesStore

Backed by multiplatform-settings rather than androidx.datastore: DataStore's non-Android/web targets are not yet shipped, while this library has full wasmJs support (Web Storage-backed), which this app's target list requires.

Constructors

Link copied to clipboard
constructor(settings: Settings)

Properties

Link copied to clipboard
open override val knownTopicsFlow: StateFlow<List<SelectableTopic>>

The full known topic catalogue, each entry flagged with whether the user follows it. The single source of truth the rest of the app reacts to: updated by syncKnownTopics (server fetch) and setSelectedTopics (user editing interests), and persisted across launches.

Link copied to clipboard
open override val selectedTopicsFlow: StateFlow<Set<Topic>>

The followed subset of knownTopicsFlow — what the feed header shows after "All".

Functions

Link copied to clipboard
open override fun hasCompletedOnboarding(): Boolean
Link copied to clipboard
open override fun knownTopics(): List<SelectableTopic>
Link copied to clipboard
open override fun selectedTopics(): Set<Topic>
Link copied to clipboard
open override fun setOnboardingCompleted()
Link copied to clipboard
open override fun setSelectedTopics(topics: Set<Topic>)
Link copied to clipboard
open override fun syncKnownTopics(fetched: List<Topic>): List<Topic>

Reconcile a catalogue fetched from GET /v1/topics with the known one: the server list wins (its order follows sort_order; topics it no longer serves drop out), selection flags are preserved by id, and topics never seen before come back as the return value so the UI can announce them. Newly discovered topics start unselected.