File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Sources/ComposableArchitecture/Observation Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 6868 }
6969
7070 extension Store where State: ObservableState , Action: BindableAction , Action. State == State {
71- @_disfavoredOverload
7271 public subscript< Value: Equatable > (
7372 dynamicMember keyPath: WritableKeyPath < State , Value >
7473 ) -> Value {
8887 Action: BindableAction ,
8988 Action. State == State
9089 {
91- @_disfavoredOverload
9290 public var state : State {
93- get { self . state }
91+ get { self . observableState }
9492 set {
9593 BindingLocal . $isActive. withValue ( true ) {
9694 self . send ( . binding( . set( \. self, newValue) ) )
106104 Action. ViewAction: BindableAction ,
107105 Action. ViewAction. State == State
108106 {
109- @_disfavoredOverload
110107 public subscript< Value: Equatable > (
111108 dynamicMember keyPath: WritableKeyPath < State , Value >
112109 ) -> Value {
127124 Action. ViewAction: BindableAction ,
128125 Action. ViewAction. State == State
129126 {
130- @_disfavoredOverload
131127 public var state : State {
132- get { self . state }
128+ get { self . observableState }
133129 set {
134130 BindingLocal . $isActive. withValue ( true ) {
135131 self . send ( . view( . binding( . set( \. self, newValue) ) ) )
Original file line number Diff line number Diff line change 1515 #endif
1616
1717 extension Store where State: ObservableState {
18- /// Direct access to state in the store when `State` conforms to ``ObservableState``.
19- public var state : State {
18+ var observableState : State {
2019 self . _$observationRegistrar. access ( self , keyPath: \. currentState)
2120 return self . currentState
2221 }
2322
23+ /// Direct access to state in the store when `State` conforms to ``ObservableState``.
24+ public var state : State {
25+ self . observableState
26+ }
27+
2428 public subscript< Value> ( dynamicMember keyPath: KeyPath < State , Value > ) -> Value {
2529 self . state [ keyPath: keyPath]
2630 }
You can’t perform that action at this time.
0 commit comments