1
1
# A Reactive Swift fork of The Composable Architecture
2
2
3
- [ ![ CI] ( https://github.com/trading-point /reactiveswift-composable-architecture/workflows/CI/badge.svg )] ( https://github.com/trading-point /reactiveswift-composable-architecture/actions?query=workflow%3ACI )
4
- [ ![ ] ( https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftrading-point %2Freactiveswift-composable-architecture%2Fbadge%3Ftype%3Dswift-versions )] ( https://swiftpackageindex.com/trading-point /reactiveswift-composable-architecture )
5
- [ ![ ] ( https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftrading-point %2Freactiveswift-composable-architecture%2Fbadge%3Ftype%3Dplatforms )] ( https://swiftpackageindex.com/trading-point /reactiveswift-composable-architecture )
3
+ [ ![ CI] ( https://github.com/ReactiveCocoa /reactiveswift-composable-architecture/workflows/CI/badge.svg )] ( https://github.com/ReactiveCocoa /reactiveswift-composable-architecture/actions?query=workflow%3ACI )
4
+ [ ![ ] ( https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FReactiveCocoa %2Freactiveswift-composable-architecture%2Fbadge%3Ftype%3Dswift-versions )] ( https://swiftpackageindex.com/ReactiveCocoa /reactiveswift-composable-architecture )
5
+ [ ![ ] ( https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FReactiveCocoa %2Freactiveswift-composable-architecture%2Fbadge%3Ftype%3Dplatforms )] ( https://swiftpackageindex.com/ReactiveCocoa /reactiveswift-composable-architecture )
6
6
7
7
[ Point-Free'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.
8
8
@@ -265,20 +265,21 @@ Once we are ready to display this view, for example in the app's entry point, we
265
265
``` swift
266
266
@main
267
267
struct CaseStudiesApp : App {
268
- var body: some Scene {
269
- AppView (
270
- store : Store (
271
- initialState : AppState (),
272
- reducer : appReducer,
273
- environment : AppEnvironment (
274
- numberFact : { number in
275
- let (data, _ ) = try await URLSession.shared
276
- .data (from : .init (string : " http://numbersapi.com/\( number ) " )! )
277
- return String (decoding : data, using : UTF8 .self )
278
- }
268
+ var body: some Scene {
269
+ AppView (
270
+ store : Store (
271
+ initialState : AppState (),
272
+ reducer : appReducer,
273
+ environment : AppEnvironment (
274
+ numberFact : { number in
275
+ let (data, _ ) = try await URLSession.shared
276
+ .data (from : .init (string : " http://numbersapi.com/\( number ) " )! )
277
+ return String (decoding : data, using : UTF8 .self )
278
+ }
279
+ )
280
+ )
279
281
)
280
- )
281
- )
282
+ }
282
283
}
283
284
```
284
285
@@ -291,13 +292,13 @@ To test, you first create a `TestStore` with the same information that you would
291
292
``` swift
292
293
@MainActor
293
294
func testFeature () async {
294
- let store = TestStore (
295
- initialState : AppState (),
296
- reducer : appReducer,
297
- environment : AppEnvironment (
295
+ let store = TestStore (
296
+ initialState : AppState (),
297
+ reducer : appReducer,
298
+ environment : AppEnvironment (
298
299
numberFact : { " \( $0 ) is a good number Brent" }
300
+ )
299
301
)
300
- )
301
302
}
302
303
```
303
304
0 commit comments