Handle number of batches / last batch

This commit is contained in:
Alfonso Grillo
2023-01-25 12:35:51 +01:00
parent ef19527856
commit aafe903e99
5 changed files with 37 additions and 15 deletions
@@ -17,6 +17,15 @@
import Combine
final class MockPollHistoryService: PollHistoryServiceProtocol {
lazy var nextBatchPublisher: AnyPublisher<TimelinePollDetails, Error> = (activePollsData + pastPollsData)
.publisher
.setFailureType(to: Error.self)
.eraseToAnyPublisher()
func nextBatch() -> AnyPublisher<TimelinePollDetails, Error> {
nextBatchPublisher
}
var updatesPublisher: AnyPublisher<TimelinePollDetails, Never> = Empty().eraseToAnyPublisher()
var updates: AnyPublisher<TimelinePollDetails, Never> {
updatesPublisher
@@ -27,14 +36,7 @@ final class MockPollHistoryService: PollHistoryServiceProtocol {
pollErrorPublisher
}
lazy var nextBatchPublisher: AnyPublisher<TimelinePollDetails, Error> = (activePollsData + pastPollsData)
.publisher
.setFailureType(to: Error.self)
.eraseToAnyPublisher()
func nextBatch() -> AnyPublisher<TimelinePollDetails, Error> {
nextBatchPublisher
}
var hasNextBatch: Bool = true
}
private extension MockPollHistoryService {