getOrCreate

inline fun <T : @Serializable Any> getOrCreate(block: EncryptedDataStoreStorageConfig.() -> Unit): Storage<T>

Creates and caches a DataStore instance for the given filename. If a DataStore with the same filename already exists in the cache, returns the existing instance. The store will not be recreated if provided with different configuration attributes on the provided EncryptedDataStoreStorageConfig.

Return

The newly created and cached DataStoreStorage instance. or if a DataStore with the given filename already exists in the cache.

Parameters

block

A lambda to configure the EncryptedDataStoreStorageConfig.