mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-05 08:09:33 +00:00
WriteStandardKeyValueRepo#unsetWithValues
This commit is contained in:
@@ -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