From a32c1d2fe084e48b4d39094be61d6840e8db6788 Mon Sep 17 00:00:00 2001 From: "Takuto NAKAMURA (Kyome)" Date: Fri, 26 Jan 2024 11:08:46 +0900 Subject: [PATCH 1/2] Make the State conform to Equatable to pass the test --- .../01-Essentials/04-ComposingFeatures/01-04-02-code-0002.swift | 2 +- .../01-Essentials/04-ComposingFeatures/01-04-02-code-0003.swift | 2 +- .../01-Essentials/04-ComposingFeatures/01-04-02-code-0004.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0002.swift b/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0002.swift index d226d37bb2bc..1067411e3ca9 100644 --- a/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0002.swift +++ b/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0002.swift @@ -2,7 +2,7 @@ import ComposableArchitecture @Reducer struct AppFeature { - struct State { + struct State: Equatable { var tab1 = CounterFeature.State() var tab2 = CounterFeature.State() } diff --git a/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0003.swift b/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0003.swift index dfc6cd3a0df4..9031b3b9a6ea 100644 --- a/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0003.swift +++ b/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0003.swift @@ -2,7 +2,7 @@ import ComposableArchitecture @Reducer struct AppFeature { - struct State { + struct State: Equatable { var tab1 = CounterFeature.State() var tab2 = CounterFeature.State() } diff --git a/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0004.swift b/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0004.swift index 8e7ad37ddfe2..b4c76fe3ba74 100644 --- a/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0004.swift +++ b/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-02-code-0004.swift @@ -2,7 +2,7 @@ import ComposableArchitecture @Reducer struct AppFeature { - struct State { + struct State: Equatable { var tab1 = CounterFeature.State() var tab2 = CounterFeature.State() } From d7a721f5ea03e134f16c1f292245d242a34a0aaf Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 25 Jan 2024 19:08:09 -0800 Subject: [PATCH 2/2] Add note about Equatable. --- .../04-ComposingFeatures/01-04-ComposingFeatures.tutorial | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-ComposingFeatures.tutorial b/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-ComposingFeatures.tutorial index 8dcfce8dc889..3546b81879d3 100644 --- a/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-ComposingFeatures.tutorial +++ b/Sources/ComposableArchitecture/Documentation.docc/Tutorials/MeetTheComposableArchitecture/01-Essentials/04-ComposingFeatures/01-04-ComposingFeatures.tutorial @@ -85,6 +85,9 @@ and actions for each tab, each of which are just the `CounterFeature`. @Code(name: "AppFeature.swift", file: 01-04-02-code-0002.swift) + + > Note: We are proactively conforming `State` to `Equatable` in order to be able to write + tests on this feature later. } @Step {