Merge pull request #93 from InsanusMokrassar/0.5.26

0.5.26
This commit is contained in:
InsanusMokrassar 2021-09-09 12:25:12 +06:00 committed by GitHub
commit 7ab7d14471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 7 deletions

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## 0.5.26
* `Repos`:
* `InMemory`:
* `MapCRUDRepo`s and `MapKeyValueRepo`s got `protected` methods and properties instead of private
## 0.5.25 ## 0.5.25
* `Versions`: * `Versions`:

View File

@ -45,5 +45,5 @@ dokka_version=1.5.0
# Project data # Project data
group=dev.inmo group=dev.inmo
version=0.5.25 version=0.5.26
android_code_version=66 android_code_version=67

View File

@ -23,13 +23,13 @@ class ReadMapCRUDRepo<ObjectType, IdType>(
} }
abstract class WriteMapCRUDRepo<ObjectType, IdType, InputValueType>( abstract class WriteMapCRUDRepo<ObjectType, IdType, InputValueType>(
private val map: MutableMap<IdType, ObjectType> = mutableMapOf() protected val map: MutableMap<IdType, ObjectType> = mutableMapOf()
) : WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> { ) : WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> {
private val _newObjectsFlow: MutableSharedFlow<ObjectType> = MutableSharedFlow() protected val _newObjectsFlow: MutableSharedFlow<ObjectType> = MutableSharedFlow()
override val newObjectsFlow: Flow<ObjectType> = _newObjectsFlow.asSharedFlow() override val newObjectsFlow: Flow<ObjectType> = _newObjectsFlow.asSharedFlow()
private val _updatedObjectsFlow: MutableSharedFlow<ObjectType> = MutableSharedFlow() protected val _updatedObjectsFlow: MutableSharedFlow<ObjectType> = MutableSharedFlow()
override val updatedObjectsFlow: Flow<ObjectType> = _updatedObjectsFlow.asSharedFlow() override val updatedObjectsFlow: Flow<ObjectType> = _updatedObjectsFlow.asSharedFlow()
private val _deletedObjectsIdsFlow: MutableSharedFlow<IdType> = MutableSharedFlow() protected val _deletedObjectsIdsFlow: MutableSharedFlow<IdType> = MutableSharedFlow()
override val deletedObjectsIdsFlow: Flow<IdType> = _deletedObjectsIdsFlow.asSharedFlow() override val deletedObjectsIdsFlow: Flow<IdType> = _deletedObjectsIdsFlow.asSharedFlow()
protected abstract suspend fun updateObject(newValue: InputValueType, id: IdType, old: ObjectType): ObjectType protected abstract suspend fun updateObject(newValue: InputValueType, id: IdType, old: ObjectType): ObjectType

View File

@ -8,7 +8,7 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableSharedFlow
class ReadMapKeyValueRepo<Key, Value>( class ReadMapKeyValueRepo<Key, Value>(
private val map: Map<Key, Value> = emptyMap() protected val map: Map<Key, Value> = emptyMap()
) : ReadStandardKeyValueRepo<Key, Value> { ) : ReadStandardKeyValueRepo<Key, Value> {
override suspend fun get(k: Key): Value? = map[k] override suspend fun get(k: Key): Value? = map[k]