File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Sources/ComposableArchitecture/SwiftUI Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ public struct BindingViewStore<State> {
210210 fileID: StaticString = #fileID,
211211 line: UInt = #line
212212 ) where Action. State == State {
213+ // TODO: Can we avoid this store scoping?
213214 self . store = store. scope ( state: { $0 } , action: Action . binding)
214215 #if DEBUG
215216 self . bindableActionType = type ( of: Action . self)
@@ -241,6 +242,7 @@ public struct BindingViewStore<State> {
241242 dynamicMember keyPath: WritableKeyPath < State , BindingState < Value > >
242243 ) -> BindingViewState < Value > {
243244 BindingViewState (
245+ // OPTIMIZE: Can we derive bindings directly from `Store` and avoid the work of creating a `ViewStore`?
244246 binding: ViewStore ( self . store, removeDuplicates: { _, _ in false } ) . binding (
245247 get: { $0 [ keyPath: keyPath] . wrappedValue } ,
246248 send: { value in
@@ -282,6 +284,7 @@ extension WithViewStore where Content: View {
282284 observe: { ( _: State ) in
283285 toViewState (
284286 BindingViewStore (
287+ // TODO: Can we avoid this store scoping?
285288 store: store. scope ( state: { $0 } , action: fromViewAction)
286289 )
287290 )
You can’t perform that action at this time.
0 commit comments