This commit is contained in:
Alfonso Grillo
2023-01-23 15:18:58 +01:00
parent 282ad810b2
commit 3704130262
4 changed files with 14 additions and 8 deletions
@@ -36,7 +36,7 @@ final class PollHistoryService: PollHistoryServiceProtocol {
updatesSubject.eraseToAnyPublisher()
}
var updatesErrors: AnyPublisher<Error, Never> {
var pollErrors: AnyPublisher<Error, Never> {
updatesErrorsSubject.eraseToAnyPublisher()
}
@@ -22,9 +22,9 @@ final class MockPollHistoryService: PollHistoryServiceProtocol {
updatesPublisher
}
var updatesErrorsPublisher: AnyPublisher<Error, Never> = Empty().eraseToAnyPublisher()
var updatesErrors: AnyPublisher<Error, Never> {
updatesErrorsPublisher
var pollErrorPublisher: AnyPublisher<Error, Never> = Empty().eraseToAnyPublisher()
var pollErrors: AnyPublisher<Error, Never> {
pollErrorPublisher
}
lazy var nextPublisher: AnyPublisher<TimelinePollDetails, Error> = (activePollsData + pastPollsData)
@@ -17,8 +17,14 @@
import Combine
protocol PollHistoryServiceProtocol {
var updates: AnyPublisher<TimelinePollDetails, Never> { get }
var updatesErrors: AnyPublisher<Error, Never> { get }
/// Returns a Publisher publishing the polls in the next batch.
/// Implementations should return the same publisher if `next()` is called again before the previous publisher completes.
func next() -> AnyPublisher<TimelinePollDetails, Error>
/// Publishes updates for the polls previously pusblished by the `next()` publishers.
var updates: AnyPublisher<TimelinePollDetails, Never> { get }
/// Publishes errors regarding poll aggregations.
/// Note: `next()` will continue to publish new polls even if some poll isn't being aggregated correctly.
var pollErrors: AnyPublisher<Error, Never> { get }
}