Slackbot
10/25/2023, 5:52 PMEduardo Dantas
10/25/2023, 5:58 PMEduardo Dantas
10/25/2023, 5:58 PMEduardo Dantas
10/25/2023, 6:06 PMEduardo Dantas
10/25/2023, 6:06 PMtypealias MyType = Int
class DataStore {
private val stores = ConcurrentHashMap<String, DataStore<MyType>>()
suspend fun get(uuid: String): DataStore<MyType> =
stores.getOrPut(uuid) {
preferencesDataStore(
name = PREFS_NAME,
produceMigrations = { context -> listOf(SharedPreferencesMigration(context, PREFS_NAME)) }
)
}
}