Migrating MVVM architecture from RxSwift to Combine
['Benoit Pasquier']
Benoit Pasquier - Swift, Data and more
// old code import RxSwift protocol CurrencyServiceObservable : class { func fetchConverter () -> Observable < Converter > } // new code import Combine protocol CurrencyServicePublisher : class { func fetchConverter () -> AnyPublisher < Converter , ErrorResult > } /// old code import RxSwift // used for data structure protocol Parsable { static func parseObject ( dictionary : [ String : AnyObject ]) -> Result < Self , ErrorResult > } // used for reactive parsable content extension ParserHelper { static func parse < T : Parsable >( data : Data ) -> Observable < [ T ] > { // ... } } extension Converter : Parsable { static func parseObject ( dictionary : [ String : AnyObject ]) -> Result < Converter , ErrorResult > { if let base = dictionary [ "base" ] as ?