CombineCommunity / RxCombine

Bi-directional type bridging between RxSwift and Apple's Combine framework
MIT License
1.03k stars 86 forks source link

Subjects/Relays overhaul #16

Closed freak4pc closed 4 years ago

freak4pc commented 4 years ago

Previously, RxSwift subjects just conformed to Combine.Subject. I thought this was clever but this easily proved to be the wrong idea :) Consider the following:

rxSubject
    .map { $0 * $0 } // Is this Combine.Subject.map, or RxSwift.Subject.map ?!

The compiler can't possibly know which Subject framework you're referring to.

For that reason, for Subjects and Relays specificallly, you should use toCombine() to get the appropriate counterpart on the Combine world.

This will give you absolute interoperability between the two.

Besides, I'm dropping the deployment target of this project to the same of RxSwift itself, since people coming from it are users of this project, and these users won't have iOS 13 obviously ;)

codecov[bot] commented 4 years ago

Codecov Report

Merging #16 into master will decrease coverage by 0.85%. The diff coverage is 91.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
- Coverage   92.55%   91.70%   -0.86%     
==========================================
  Files          11       14       +3     
  Lines         551      675     +124     
==========================================
+ Hits          510      619     +109     
- Misses         41       56      +15     
Impacted Files Coverage Δ
Sources/Combine+Rx/Publisher+Rx.swift 100.00% <ø> (ø)
Sources/Combine+Rx/Subject+Rx.swift 100.00% <ø> (ø)
Sources/Common/DemandBuffer.swift 100.00% <ø> (ø)
Sources/Rx+Combine/Observable+Combine.swift 100.00% <ø> (ø)
Sources/Rx+Combine/RxSubscription.swift 44.44% <ø> (-22.23%) :arrow_down:
Tests/ObservableAsPublisherTests.swift 96.15% <ø> (ø)
Tests/PublisherAsObservableTests.swift 97.61% <ø> (+0.05%) :arrow_up:
Sources/Rx+Combine/Relays+Combine.swift 50.00% <50.00%> (-5.56%) :arrow_down:
Sources/Rx+Combine/BehaviorRelay+Combine.swift 64.70% <64.70%> (ø)
Sources/Rx+Combine/PublishRelay+Combine.swift 73.33% <73.33%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d4643c1...32496fe. Read the comment docs.