This commit is contained in:
InsanusMokrassar committed 2021-06-15 14:24:00 +06:00
1 parent eba41066b4
commit a411355b4f
11 files changed
+94 -13

No files matched your search

@@ -86,6 +86,12 @@ class MapWriteOneToManyKeyValueRepo<Key, Value>(
override suspend fun clear(k: Key) {
map.remove(k) ?.also { _onDataCleared.emit(k) }
}
override suspend fun clearWithValue(v: Value) {
map.forEach { (k, values) ->
if (values.remove(v)) _onValueRemoved.emit(k to v)
}
}
}
class MapOneToManyKeyValueRepo<Key, Value>(