Skip to content

Commit 42192d4

Browse files
authored
Don't report unasserted shared changes in Reducer._printChanges() (#3528)
* Don't report unasserted shared changes in `Reducer._printChanges()` * fix * wip * wip * wip
1 parent cc17134 commit 42192d4

File tree

6 files changed

+192
-24
lines changed

6 files changed

+192
-24
lines changed

.github/package.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ComposableArchitecture.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 168 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/SyncUps/SyncUps/AppFeature.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct AppView: View {
7676
.productMock,
7777
.engineeringMock,
7878
]
79-
return AppView(
79+
AppView(
8080
store: Store(initialState: AppFeature.State()) {
8181
AppFeature()
8282
}

Examples/SyncUps/SyncUps/SyncUpsList.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct SyncUpsList {
5454
?? Attendee(id: Attendee.ID(uuid()))
5555
)
5656
}
57-
state.$syncUps.withLock { $0.append(syncUp) }
57+
state.$syncUps.withLock { _ = $0.append(syncUp) }
5858
state.destination = nil
5959
return .none
6060

@@ -80,7 +80,7 @@ struct SyncUpsListView: View {
8080

8181
var body: some View {
8282
List {
83-
ForEach(store.$syncUps) { $syncUp in
83+
ForEach(Array(store.$syncUps)) { $syncUp in
8484
NavigationLink(state: AppFeature.Path.State.detail(SyncUpDetail.State(syncUp: $syncUp))) {
8585
CardView(syncUp: syncUp)
8686
}
@@ -161,7 +161,7 @@ extension LabelStyle where Self == TrailingIconLabelStyle {
161161
.productMock,
162162
.engineeringMock,
163163
]
164-
return NavigationStack {
164+
NavigationStack {
165165
SyncUpsListView(
166166
store: Store(initialState: SyncUpsList.State()) {
167167
SyncUpsList()

Package.resolved

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/ComposableArchitecture/Reducer/Reducers/DebugReducer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public struct _PrintChangesReducer<Base: Reducer>: Reducer {
8686
into state: inout Base.State, action: Base.Action
8787
) -> Effect<Base.Action> {
8888
if let printer = self.printer {
89-
let changeTracker = SharedChangeTracker()
89+
let changeTracker = SharedChangeTracker(reportUnassertedChanges: false)
9090
return changeTracker.track {
9191
let oldState = UncheckedSendable(state)
9292
let effects = self.base.reduce(into: &state, action: action)

0 commit comments

Comments
 (0)