mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2026-11-02 10:03:01 +00:00
WriteStandardKeyValueRepo#unsetWithValues
This commit is contained in:
1 parent
3ae9b3e576
commit
091cb38339
9 files changed
+74
-7
No files matched your search
@@ -76,6 +76,15 @@ class WriteMapKeyValueRepo<Key, Value>(
|
||||
map.remove(k) ?.also { _ -> _onValueRemoved.emit(k) }
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun unsetWithValues(toUnset: List<Value>) {
|
||||
map.forEach {
|
||||
if (it.value in toUnset) {
|
||||
map.remove(it.key)
|
||||
_onValueRemoved.emit(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MapKeyValueRepo<Key, Value>(
|
||||
|
||||
Reference in new issue
Block a user