Skip to content

Commit 4465e4e

Browse files
Kyome22mbrandonw
andauthored
Fix Composing features tutorial; Modify Make the State conform to Equatable to pass the test. (#2727)
* Make the State conform to Equatable to pass the test * Add note about Equatable. --------- Co-authored-by: Brandon Williams <[email protected]>
1 parent 36331fc commit 4465e4e

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0002.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ComposableArchitecture
22

33
@Reducer
44
struct AppFeature {
5-
struct State {
5+
struct State: Equatable {
66
var tab1 = CounterFeature.State()
77
var tab2 = CounterFeature.State()
88
}

Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0003.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ComposableArchitecture
22

33
@Reducer
44
struct AppFeature {
5-
struct State {
5+
struct State: Equatable {
66
var tab1 = CounterFeature.State()
77
var tab2 = CounterFeature.State()
88
}

Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0004.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ComposableArchitecture
22

33
@Reducer
44
struct AppFeature {
5-
struct State {
5+
struct State: Equatable {
66
var tab1 = CounterFeature.State()
77
var tab2 = CounterFeature.State()
88
}

Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-ComposingFeatures.tutorial

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585
and actions for each tab, each of which are just the `CounterFeature`.
8686

8787
@Code(name: "AppFeature.swift", file: 01-04-02-code-0002.swift)
88+
89+
> Note: We are proactively conforming `State` to `Equatable` in order to be able to write
90+
tests on this feature later.
8891
}
8992

9093
@Step {

0 commit comments

Comments
 (0)