Creating a store for android/ios is fairly straightforward
//android
val filesDir: String = androidContext().filesDir.path
storeOf(file = "$filesDir/countries.json".toPath(), default = emptyList())
// ios
val filesDir: String? = NSFileManager.defaultManager.DocumentDirectory?.relativePath
requireNotNull(filesDir) { "Document directory not found" }
storeOf(file = "$filesDir/countries.json".toPath(), default = emptyList())
However, for desktop we need this extra step
// desktop
val filesDir: String = AppDirsFactory.getInstance()
.getUserDataDir(PACKAGE_NAME, VERSION, AUTHOR)
FILE_SYSTEM.createDirectories(filesDir.toPath())
storeOf(file = "$filesDir/countries.json".toPath(), default = emptyList())
Need to think of an API to bridge this gap
Creating a store for android/ios is fairly straightforward
However, for desktop we need this extra step
Need to think of an API to bridge this gap