This commit is contained in:
2021-06-15 14:24:00 +06:00
parent eba41066b4
commit a411355b4f
11 changed files with 94 additions and 13 deletions

View File

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