You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Pointfreeco's](https://github.com/pointfreeco)[The Composable Architecture](https://github.com/pointfreeco/swift-composable-architecture) uses Apple's Combine framework as the basis of its `Effect` type. Unfortunately, Combine is only available on iOS 13 and macOS 10.15 and above. In order to be able to use it with earlier versions of the OSes, this fork has adapted The Composable Architecture to use [Reactive Swift](https://github.com/ReactiveCocoa/ReactiveSwift) as the basis for the `Effect` type.
4
7
5
-
Current status:
8
+
## Effect type implementations
9
+
<details>
10
+
<summary>Combine vs ReactiveSwift</summary>
6
11
7
-
*[x] ComposableArchitecture library builds
8
-
*[x] ComposableArchitectureTests all pass
9
-
*[x] The UIKit Case Studies examples build and run correctly
10
-
*[x] The SwiftUI Case Studies examples build and run correctly
11
-
*[x] ComposableCoreLocation to builds
12
-
*[x] ComposableCoreLocationTests all pass
13
-
*[x] All examples projects build and have passing tests.
12
+
In Pointfreeco's composable architecture the `Effect` type wraps a Combine `Producer`, and also conforms to the `Publisher` protocol. This is required due to the way that each operation on a `Publisher` (e.g. `map`) returns a new type of Publisher (`Publishers.Map` in the case of `map`), so in order to have a single `Effect` type these publisher types always need to be erased back to just the `Effect` type with `eraseToEffect()`.
14
13
15
-
The following changes are still needed:
14
+
Using ReactiveSwift, which doesn't use Combine's type model, `Effect<Output, Failure>` is simply a typealias for `SignalProducer<Value, Error>`. There is never a need to type erase. Also, due to ReactiveSwift's lifetime based disposable handling, you rarely need to keep a reference to a `Disposable`, unlike in Combine, where you must always keep a reference to any `Cancellable` otherwise it will terminate immediately.
16
15
17
-
*[ ] Change the documentation (docs and code comments) to reflect the use or ReactiveSwift
The Composable Architecture is a library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind. It can be used in SwiftUI, UIKit, and more, and on any Apple platform (iOS, macOS, tvOS, and watchOS).
27
22
@@ -78,8 +73,8 @@ This repo comes with _lots_ of examples to demonstrate how to solve common and c
78
73
* Navigation
79
74
* Higher-order reducers
80
75
* Reusable components
81
-
82
-
The following examples have not yet been adapted for ReactiveSwift
76
+
77
+
The following examples have not yet been adapted for ReactiveSwift
83
78
*[Location manager](./Examples/LocationManager)
84
79
*[Motion manager](./Examples/MotionManager)
85
80
*[Search](./Examples/Search)
@@ -232,11 +227,11 @@ It is also straightforward to have a UIKit controller driven off of this store.
232
227
233
228
// Omitted: Add subviews and set up constraints...
@@ -421,7 +416,7 @@ If you are interested in contributing a wrapper library for a framework that we
421
416
422
417
You would probably still want something like a `UIScheduler` so that you don't needlessly perform thread hops.
423
418
</details>
424
-
419
+
425
420
## Requirements
426
421
427
422
This fork of The Composable Architecture uses the ReactiveSwift framework, it currently requires minimum deployment targets of iOS 12, macOS 10.14, Mac Catalyst 14, tvOS 14, and watchOS 5, although it may be possible to support earlier versions too.
@@ -431,7 +426,7 @@ This fork of The Composable Architecture uses the ReactiveSwift framework, it cu
431
426
You can add ComposableArchitecture to an Xcode project by adding it as a package dependency.
432
427
433
428
1. From the **File** menu, select **Swift Packages › Add Package Dependency…**
434
-
2. Enter "https://github.com/trading-point/swift-composable-architecture" into the package repository URL text field
429
+
2. Enter "https://github.com/trading-point/reactiveswift-composable-architecture" into the package repository URL text field
435
430
3. Depending on how your project is structured:
436
431
- If you have a single application target that needs access to the library, then add **ComposableArchitecture** directly to your application.
437
432
- If you want to use this library from multiple targets you must create a shared framework that depends on **ComposableArchitecture** and then depend on that framework in all of your targets. For an example of this, check out the [Tic-Tac-Toe](./Examples/TicTacToe) demo application, which splits lots of features into modules and consumes the static library in this fashion using the **TicTacToeCommon** framework.
@@ -463,7 +458,7 @@ There are also many architecture libraries in the Swift and iOS community. Each
0 commit comments