Skip to content

Commit daff580

Browse files
committed
Revert #1802
Fixes #1812. This regression was subtle, but it's better to retain the old crashing behavior than introduce this change since it's been with the library for a very long time, and we have workarounds like `ForEachStore`. We'll try to re-explore these subtle binding behaviors in the future.
1 parent 9e5221a commit daff580

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Sources/ComposableArchitecture/ViewStore.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,8 @@ public final class ViewStore<ViewState, ViewAction>: ObservableObject {
466466
get: @escaping (ViewState) -> Value,
467467
send valueToAction: @escaping (Value) -> ViewAction
468468
) -> Binding<Value> {
469-
let base = ObservedObject(wrappedValue: self)
469+
ObservedObject(wrappedValue: self)
470470
.projectedValue[get: .init(rawValue: get), send: .init(rawValue: valueToAction)]
471-
472-
return Binding(get: { base.wrappedValue }, set: { base.transaction($1).wrappedValue = $0 })
473471
}
474472

475473
/// Derives a binding from the store that prevents direct writes to state and instead sends

0 commit comments

Comments
 (0)