diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e9613a..0686dd8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Sources/Classes/DataLoading/Cursors/TotalCountCursor.swift b/Sources/Classes/DataLoading/Cursors/TotalCountCursor.swift index b993b04e..c40393f0 100644 --- a/Sources/Classes/DataLoading/Cursors/TotalCountCursor.swift +++ b/Sources/Classes/DataLoading/Cursors/TotalCountCursor.swift @@ -54,8 +54,12 @@ open class TotalCountCursor: configuration = other.configuration.reset() } - open func loadNextBatch() -> Single<[Element]> { + open func processResultFromConfigurationSingle() -> Single { 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