DataStoreStorage

class DataStoreStorage(context: ERROR CLASS: Symbol not found for Context) : Storage

An implementation of the Storage interface that uses Android's Jetpack DataStore for persistence. This class is designed to be a modern replacement for SharedPreferences-based storage.

Parameters

context

The application context, used to get the DataStore instance.

Constructors

Link copied to clipboard
constructor(context: ERROR CLASS: Symbol not found for Context)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun get(key: String): String?

Retrieves the value associated with the given key from DataStore. This operation is performed asynchronously.

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

Removes the value associated with the given key from DataStore. This operation is performed asynchronously.

Link copied to clipboard
open suspend override fun set(key: String, content: Any)

Sets the value for the given key in DataStore. The content is converted to a String. This operation is performed asynchronously.