Skip to content

Commit d69b5db

Browse files
authored
Fix view state binding equatability (#2255)
* Fix view state binding equatability * wip * wip * wip * wip * wip
1 parent 521f13c commit d69b5db

File tree

7 files changed

+401
-447
lines changed

7 files changed

+401
-447
lines changed

Examples/CaseStudies/SwiftUICaseStudies/03-NavigationStack.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,19 @@ struct NavigationDemoView: View {
121121
switch $0 {
122122
case .screenA:
123123
CaseLet(
124-
state: /NavigationDemo.Path.State.screenA,
124+
/NavigationDemo.Path.State.screenA,
125125
action: NavigationDemo.Path.Action.screenA,
126126
then: ScreenAView.init(store:)
127127
)
128128
case .screenB:
129129
CaseLet(
130-
state: /NavigationDemo.Path.State.screenB,
130+
/NavigationDemo.Path.State.screenB,
131131
action: NavigationDemo.Path.Action.screenB,
132132
then: ScreenBView.init(store:)
133133
)
134134
case .screenC:
135135
CaseLet(
136-
state: /NavigationDemo.Path.State.screenC,
136+
/NavigationDemo.Path.State.screenC,
137137
action: NavigationDemo.Path.Action.screenC,
138138
then: ScreenCView.init(store:)
139139
)

Examples/Standups/StandupsTests/AppFeatureTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ final class AppFeatureTests: XCTestCase {
9494

9595
var savedStandup = standup
9696
savedStandup.title = "Blob"
97-
XCTAssertEqual(savedData.value, try! JSONEncoder().encode([savedStandup]))
97+
XCTAssertNoDifference(
98+
try JSONDecoder().decode([Standup].self, from: savedData.value!),
99+
[savedStandup]
100+
)
98101
}
99102

100103
func testRecording() async {

Sources/ComposableArchitecture/Reducer/Reducers/Reduce.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public struct Reduce<State, Action>: ReducerProtocol {
1717
///
1818
/// - Parameter reduce: A function that is called when ``reduce(into:action:)`` is invoked.
1919
@inlinable
20-
public init(_ reduce: @escaping (inout State, Action) -> EffectTask<Action>) {
20+
public init(_ reduce: @escaping (_ state: inout State, _ action: Action) -> EffectTask<Action>) {
2121
self.init(internal: reduce)
2222
}
2323

0 commit comments

Comments
 (0)