storeOf

inline fun <T : @Serializable Any> storeOf(key: String, default: T? = null, enableCache: Boolean = true, format: StringFormat = DefaultJson, storage: Storage = localStorage): KStore<T>

Creates a store with StorageCodec

Return

store that contains a value of type T

Parameters

key

key for the record that is managed by this store

default

returns this value if the record is not found. defaults to null

enableCache

maintain a cache. If set to false, it always reads from storage

format

Serializer to use. defaults to DefaultJson