WriteStandardKeyValueRepo#unsetWithValues

This commit is contained in:
2020-12-05 17:52:37 +06:00
parent 3ae9b3e576
commit 091cb38339
9 changed files with 74 additions and 7 deletions

View File

@@ -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>(