From 7990b21cc58aff9156cc8c71f931a3d9036b667b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 16 May 2022 17:34:34 +0600 Subject: [PATCH] add SharedPreferencesKeyValueRepo --- CHANGELOG.md | 4 ++++ .../dev/inmo/micro_utils/repos/keyvalue/KeyValueStore.kt | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e95dee88c5..0fd9051529f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.10.5 +* `Repos` + * `Android`: + * New function `SharedPreferencesKeyValueRepo` + ## 0.10.4 * `Versions`: diff --git a/repos/common/src/main/kotlin/dev/inmo/micro_utils/repos/keyvalue/KeyValueStore.kt b/repos/common/src/main/kotlin/dev/inmo/micro_utils/repos/keyvalue/KeyValueStore.kt index bc863224c42..440490f51ea 100644 --- a/repos/common/src/main/kotlin/dev/inmo/micro_utils/repos/keyvalue/KeyValueStore.kt +++ b/repos/common/src/main/kotlin/dev/inmo/micro_utils/repos/keyvalue/KeyValueStore.kt @@ -160,3 +160,9 @@ class KeyValueStore internal constructor ( } } } + +inline fun SharedPreferencesKeyValueRepo( + context: Context, + name: String = "default", + cacheValues: Boolean = false +) = context.keyValueStore(name, cacheValues)