Skip to content

Commit 787ec31

Browse files
committed
Combine comparison and other info
1 parent 34c7aef commit 787ec31

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

Documentation/ComparisonWithOtherLibraries.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
## Comparison with ReactiveSwift
1+
# Comparison with other libraries
2+
3+
This section attempts to compare RxSwift with other known and popular alternatives.
4+
5+
The best part about reactive programming is that most of the concepts you'll learn from either of these frameworks are entirely applicable to RxSwift, and vice-versa, with only relatively minor framework-specific concepts and naming conventions.
6+
7+
## Apple's Combine
8+
9+
Combine is Apple's own implementation of the [Reactive Streams](https://www.reactive-streams.org) standard. The main differences to consider are that Combine uses typed errors, and supports backpressure. Its huge downside is that it's closed source, limited to iOS 13 and up, and does not support Linux as of today.
10+
11+
It also does not have its own testing framework like RxTest or RxBlocking, and doesn't have its own UIKit-supporting framework such as RxCocoa, since it is more aimed towards SwiftUI. Some of these issues have been addressed by community projects such as [CombineCocoa](https://github.com/CombineCommunity/CombineCocoa), [combine-schedulers](https://github.com/pointfreeco/combine-schedulers) and [CombineExpectations](https://github.com/groue/CombineExpectations).
12+
13+
It is also (as of 2020) a relatively young and not as battle-tested as RxSwift or ReactiveSwift which are around for over half a decade.
14+
15+
If you're interested in using Combine for your relatively modern codebase while still using your RxSwift codebase, you can leverage [RxCombine](https://github.com/CombineCommunity/RxCombine), a community project which aims to provide interoperatbility between Combine and RxSwift.
16+
17+
## ReactiveSwift
218

319
RxSwift is somewhat similar to ReactiveSwift since ReactiveSwift borrows a large number of concepts from Rx.
420

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ KVO observation, async operations, UI Events and other streams of data are all u
5454

5555
###### ... compare
5656

57-
* [with other libraries](Documentation/ComparisonWithOtherLibraries.md).
57+
* [with Combine and ReactiveSwift](Documentation/ComparisonWithOtherLibraries.md).
5858

5959
###### ... understand the structure
6060

Tests/RxSwiftTests/Observable+JustTests.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class ObservableJustTest : RxTest {
1616
extension ObservableJustTest {
1717
func testJust_Immediate() {
1818
let scheduler = TestScheduler(initialClock: 0)
19-
20-
let totalPrice: Observable<Decimal>
21-
19+
2220
let res = scheduler.start {
2321
return Observable.just(42)
2422
}

0 commit comments

Comments
 (0)