All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.github.rotbolt.flakerdata.flakerprefs.DataStoreFactory.kt Maven / Gradle / Ivy

There is a newer version: 0.1.2
Show newest version
package io.github.rotbolt.flakerdata.flakerprefs

import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.PreferenceDataStoreFactory
import androidx.datastore.preferences.core.Preferences
import okio.Path.Companion.toPath

expect class DataStoreFactory {

    fun create(): DataStore
}

internal fun createDataStore(
    producePath: () -> String,
): DataStore = PreferenceDataStoreFactory.createWithPath(
    corruptionHandler = null,
    migrations = emptyList(),
    produceFile = { producePath().toPath() },
)

internal const val DATASTORE_FILE_NAME = "flaker.preferences_pb"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy