mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-18 14:23:50 +00:00
new crud repo extensions on*
This commit is contained in:
parent
3e3fbd97eb
commit
c6eab182f6
@ -6,6 +6,7 @@
|
||||
* `Common`:
|
||||
* All `Repo`s get `diff` extensions
|
||||
* `KeyValueRepo` and `KeyValuesRepo` get `applyDiff` extension
|
||||
* Add new extensions `on*` flows for crud repos
|
||||
|
||||
## 0.20.48
|
||||
|
||||
|
@ -42,6 +42,22 @@ interface WriteCRUDRepo<ObjectType, IdType, InputValueType> : Repo {
|
||||
}
|
||||
typealias WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> = WriteCRUDRepo<ObjectType, IdType, InputValueType>
|
||||
|
||||
/**
|
||||
* Just mirroring [WriteCRUDRepo.newObjectsFlow] to be same as in KV repos
|
||||
*/
|
||||
val <ObjectType> WriteCRUDRepo<ObjectType, *, *>.onNewObjects: Flow<ObjectType>
|
||||
get() = newObjectsFlow
|
||||
/**
|
||||
* Just mirroring [WriteCRUDRepo.updatedObjectsFlow] to be same as in KV repos
|
||||
*/
|
||||
val <ObjectType> WriteCRUDRepo<ObjectType, *, *>.onUpdatedObjects: Flow<ObjectType>
|
||||
get() = updatedObjectsFlow
|
||||
/**
|
||||
* Just mirroring [WriteCRUDRepo.deletedObjectsIdsFlow] to be same as in KV repos
|
||||
*/
|
||||
val <IdType> WriteCRUDRepo<*, IdType, *>.onDeletedObjectsIds: Flow<IdType>
|
||||
get() = deletedObjectsIdsFlow
|
||||
|
||||
suspend fun <ObjectType, IdType, InputValueType> WriteCRUDRepo<ObjectType, IdType, InputValueType>.create(
|
||||
vararg values: InputValueType
|
||||
): List<ObjectType> = create(values.toList())
|
||||
|
Loading…
Reference in New Issue
Block a user