GlanceStateDefinition
interface GlanceStateDefinition<T : Any?>
PreferencesGlanceStateDefinition |
Base class helping the creation of a state using DataStore's |
Configuration definition for GlanceState. This defines where the data is stored and how the underlying data store is created. Use a unique GlanceStateDefinition to get a GlanceState, once defined, the data should be updated using the state directly, this definition should not change.
Summary
Public functions |
|
|---|---|
suspend DataStore<T> |
getDataStore(context: Context, fileKey: String)Creates the underlying data store. |
File |
getLocation(context: Context, fileKey: String)This file indicates the location of the persisted data. |
Public functions
getDataStore
suspend fun getDataStore(context: Context, fileKey: String): DataStore<T>
Creates the underlying data store.
getLocation
fun getLocation(context: Context, fileKey: String): File
This file indicates the location of the persisted data.