Architecture EDD [iOS] Combine, RxSwift 차이

[iOS] Combine, RxSwift 차이

Deployment Target

  • RxSwift
    • iOS 8.0+
  • Combine
    • iOS 13.0+

Platforms supported

  • RxSwift
    • iOS, macOS, tvOS, watchOS, Linux
  • Combine
    • iOS, macOS, tvOS, watchOS, UIKit for Mac

Spec

  • RxSwift
    • Reactive Extension(ReactiveX)
  • Combine
    • Reactive Steams(+adjustments)

Framework Consumption

  • RxSwift
    • Third-party
  • Combine
    • First-party(built-in)

Maintained by

  • RxSwift
    • Open-Source / Community
  • Combine
    • Apple

UIBindings

  • RxSwift
    • RxCocoa
  • Combine
    • SwiftUI

Types

Observable, Publisher

  • RxSwift
    // class Type
    Observable<Element>
    
  • Combine
    //struct Type
    AnyPublisher<Element, Error> 
    

Subject

  • RxSwift
    PublishSubject<Element>
    BehaviorSubject<Element>
    Observable.just(1)
    
  • Combine
    PassthroughSubject<Element, Error>
    CurrentValueSubject<Element, Error>
    Just(1)
    

Operator

  • RxSwift
    .subscribe()
    .onNext()
    .onComplated()
    .bind(to: )
    
  • Combine
    .sink()
    .send()
    .send(completion .finished)
    .subscribe()
    

Memory

  • RxSwift
    Disposable 
    DisposeBag()
    
  • Combine
    Cancellable
    [Cancelable]()
    

Thread

  • RxSwift
    .observe(on: )
    .subscribe(on: )
    
  • Combine
    .receive(on: )
    .subscribe(on: )
    

출처

상어의 개발 블로그

댓글남기기