Merge pull request #217 from TouchInstinct/fix/cursor

Add method for processing cursor response
This commit is contained in:
Ivan Babkin 2019-08-30 14:08:21 +03:00 committed by GitHub
commit 1832520a6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# Changelog
### 0.9.26
- **Add**: possibility to override `loadNextBatch` method from `TotalCountCursor`.
- **Add**: method `processResultFromConfigurationSingle` for `TotalCountCursor` that allows to get server response.
- **Add**: possibility to inherit from `TotalCountCursor`.
### 0.9.25

View File

@ -54,8 +54,12 @@ open class TotalCountCursor<CursorConfiguration: TotalCountCursorConfiguration>:
configuration = other.configuration.reset()
}
open func loadNextBatch() -> Single<[Element]> {
open func processResultFromConfigurationSingle() -> Single<CursorConfiguration.ResultType> {
return configuration.resultSingle()
}
public func loadNextBatch() -> Single<[Element]> {
return processResultFromConfigurationSingle()
.do(onSuccess: { [weak self] listingResult in
self?.totalCount = listingResult.totalCount
self?.elements = (self?.elements ?? []) + listingResult.results