Merge pull request #217 from TouchInstinct/fix/cursor
Add method for processing cursor response
This commit is contained in:
commit
1832520a6d
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue