mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-23 09:07:14 +00:00
commit
f94b085850
@ -1,5 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.12.7
|
||||||
|
|
||||||
|
* `Repos`:
|
||||||
|
* `Cache`:
|
||||||
|
* Force `WriteCRUDCacheRepo` to subscribe on new and updated objects of parent repo
|
||||||
|
* `Pagination`:
|
||||||
|
* New function `changeResultsUnchecked(Pagination)`
|
||||||
|
|
||||||
## 0.12.6
|
## 0.12.6
|
||||||
|
|
||||||
* `MimeeTypes>`:
|
* `MimeeTypes>`:
|
||||||
|
@ -14,5 +14,5 @@ crypto_js_version=4.1.1
|
|||||||
# Project data
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=0.12.6
|
version=0.12.7
|
||||||
android_code_version=145
|
android_code_version=146
|
||||||
|
@ -48,6 +48,14 @@ data class PaginationResult<T>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun <T> emptyPaginationResult() = PaginationResult<T>(0, 0, emptyList(), 0L)
|
fun <T> emptyPaginationResult() = PaginationResult<T>(0, 0, emptyList(), 0L)
|
||||||
|
fun <T> emptyPaginationResult(
|
||||||
|
basePagination: Pagination
|
||||||
|
) = PaginationResult<T>(
|
||||||
|
basePagination.page,
|
||||||
|
basePagination.size,
|
||||||
|
emptyList(),
|
||||||
|
0L
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return New [PaginationResult] with [data] without checking of data sizes equality
|
* @return New [PaginationResult] with [data] without checking of data sizes equality
|
||||||
|
@ -33,6 +33,14 @@ open class WriteCRUDCacheRepo<ObjectType, IdType, InputValueType>(
|
|||||||
override val updatedObjectsFlow: Flow<ObjectType> by parentRepo::updatedObjectsFlow
|
override val updatedObjectsFlow: Flow<ObjectType> by parentRepo::updatedObjectsFlow
|
||||||
override val deletedObjectsIdsFlow: Flow<IdType> by parentRepo::deletedObjectsIdsFlow
|
override val deletedObjectsIdsFlow: Flow<IdType> by parentRepo::deletedObjectsIdsFlow
|
||||||
|
|
||||||
|
val createdObjectsFlowJob = parentRepo.newObjectsFlow.onEach {
|
||||||
|
kvCache.set(idGetter(it), it)
|
||||||
|
}.launchIn(scope)
|
||||||
|
|
||||||
|
val updatedObjectsFlowJob = parentRepo.updatedObjectsFlow.onEach {
|
||||||
|
kvCache.set(idGetter(it), it)
|
||||||
|
}.launchIn(scope)
|
||||||
|
|
||||||
val deletedObjectsFlowJob = parentRepo.deletedObjectsIdsFlow.onEach {
|
val deletedObjectsFlowJob = parentRepo.deletedObjectsIdsFlow.onEach {
|
||||||
kvCache.unset(it)
|
kvCache.unset(it)
|
||||||
}.launchIn(scope)
|
}.launchIn(scope)
|
||||||
|
Loading…
Reference in New Issue
Block a user