sergdort / CleanArchitectureRxSwift

Example of Clean Architecture of iOS app using RxSwift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Combine Version of ActivityIndicator and ErrorTacker

mahi8514 opened this issue · comments

HI,
First to say, this an awesome project which focus on Clean Architecture and my main reference. Now i am on a Combine project and requires ActivityIndicator and ErrorTracker on Combine Version.

I have created an extension for Publisher like this

public extension Publisher where Failure: Error { func trackError(errorss: PassthroughSubject<Error, Never>) -> AnyPublisher<Output, Failure> { return handleEvents(receiveCompletion: { completion in if case let .failure(error) = completion { errorss.send(error) } }).eraseToAnyPublisher() } }