androidMain.io.github.rotbolt.flakerdata.flakerprefs.DataStoreFactory.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of flaker-data Show documentation
Show all versions of flaker-data Show documentation
Persistence module for flaker.
package io.github.rotbolt.flakerdata.flakerprefs
import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
actual class DataStoreFactory(private val context: Context) {
actual fun create(): DataStore {
return createDataStore { context.filesDir.resolve(DATASTORE_FILE_NAME).absolutePath }
}
}