storeOf

inline fun <T : @Serializable Any> storeOf(file: Path, default: T? = null, enableCache: Boolean = true, json: Json = DefaultJson): KStore<T>

Creates a store with FileCodec

Return

store that contains a value of type T

Parameters

file

path to the file that is managed by this store

default

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

enableCache

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

json

JSON Serializer to use. defaults to DefaultJson