File tree Expand file tree Collapse file tree
Application/DevLogPresentation/Sources/Today Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,8 +137,9 @@ struct TodayFeature {
137137 }
138138 }
139139
140- enum Action : Equatable {
140+ enum Action : BindableAction , Equatable {
141141 case alert( PresentationAction < Never > )
142+ case binding( BindingAction < State > )
142143 case refresh
143144 case fetchData
144145 case setSectionScope( SectionScope )
@@ -171,10 +172,16 @@ struct TodayFeature {
171172 Scope ( state: \. loading, action: \. loading) {
172173 LoadingFeature ( )
173174 }
175+ BindingReducer ( )
174176 Reduce { state, action in
175177 switch action {
176178 case . alert:
177179 break
180+ case . binding( \. displayOptions. dueDateVisibility) ,
181+ . binding( \. displayOptions. focusVisibility) :
182+ return updateDisplayOptionsEffect ( state. displayOptions)
183+ case . binding:
184+ break
178185 case . refresh, . fetchData:
179186 return fetchTodosEffect ( )
180187 case . setSectionScope( let scope) :
Original file line number Diff line number Diff line change @@ -84,10 +84,7 @@ struct TodayView: View {
8484 Menu {
8585 Picker (
8686 String ( localized: " today_due_visibility_label " ) ,
87- selection: Binding (
88- get: { store. displayOptions. dueDateVisibility } ,
89- set: { store. send ( . setDueDateVisibility( $0) ) }
90- )
87+ selection: $store. displayOptions. dueDateVisibility
9188 ) {
9289 ForEach ( TodayDisplayOptions . DueDateVisibility. allCases, id: \. self) { option in
9390 Text ( option. title) . tag ( option)
You can’t perform that action at this time.
0 commit comments