DataStoreStorage

inline fun <T : @Serializable Any> DataStoreStorage(dataStore: DataStore<T?>, cacheStrategy: CacheStrategy = CacheStrategy.NO_CACHE, file: File? = null): Storage<T>

Creates a new Storage instance for storing serializable objects in DataStore.

Return

A new Storage instance.

Parameters

T

The type of the object to be stored. Must be serializable.

dataStore

The DataStore instance to use for storing the object.

cacheStrategy

Cache strategy to use for caching the item in memory.