xxfast
09/09/2022, 5:29 AMFileSystem
? Always get
Caused by: android.system.ErrnoException: open failed: EROFS (Read-only file system)
when I do this on androidMain
FileSystem.SYSTEM.sink("test.json".toPath)
saket
09/09/2022, 6:18 AMxxfast
09/09/2022, 6:19 AMxxfast
09/09/2022, 7:07 AMFileSystem.SYSTEM.sink("${context.filesDir.path}/test.json".toPath())
xxfast
09/09/2022, 7:10 AMyschimke
09/09/2022, 7:43 AMxxfast
09/10/2022, 1:42 AMval updates: Flow<T?> get() = this.stateFlow
.onStart { read() }
and added a test case for this with
@Test
fun testUpdatesWithPreviouslyStoredValue() = runTest {
FILE_SYSTEM.sink(filePath.toPath()).buffer().use { Json.encode(OREO, it) }
val newStore: KStore<Pet> = store(filePath = filePath)
newStore.updates.test {
assertEquals(OREO, awaitItem())
}
}
More in https://github.com/xxfast/KStore/commit/cca82cfd4c8d914812ee8a700a140a3d1caa687d