File tree 4 files changed +15
-15
lines changed 4 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ import Combine
3
3
import SwiftDux
4
4
5
5
struct NewTodoContainer : ConnectableView {
6
- @MappedDispatch ( ) private var dispatch
7
-
8
6
var id : String
9
7
8
+ @MappedDispatch ( ) private var dispatch
9
+
10
10
func map( state: AppState , binder: StateBinder ) -> Binding < String > ? {
11
11
guard let todoList = state. todoLists [ id] else { return nil }
12
12
return binder. bind ( todoList. newTodoText) {
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import SwiftDux
3
3
import Combine
4
4
5
5
struct TodoContainer : ConnectableView {
6
-
7
6
var todoListId : String
8
7
var todoId : String
9
8
Original file line number Diff line number Diff line change @@ -3,17 +3,19 @@ import SwiftDux
3
3
import Combine
4
4
5
5
struct TodoListBrowserContainer : ConnectableView {
6
-
7
- // struct Props: Equatable {
8
- // var todoLists: OrderedState<TodoList>
9
- // var selectedTodoListId: String?
10
- // }
11
-
12
6
@Environment ( \. horizontalSizeClass) private var sizeClass
13
7
@MappedDispatch ( ) private var dispatch
14
8
15
- func map( state: AppState ) -> AppState ? {
16
- state
9
+ struct Props : Equatable {
10
+ var todoLists : OrderedState < TodoList >
11
+ var selectedTodoListId : String ?
12
+ }
13
+
14
+ func map( state: AppState ) -> Props ? {
15
+ Props (
16
+ todoLists: state. todoLists,
17
+ selectedTodoListId: state. selectedTodoListId
18
+ )
17
19
}
18
20
19
21
func body( props: Props ) -> some View {
Original file line number Diff line number Diff line change @@ -3,11 +3,10 @@ import Combine
3
3
import SwiftDux
4
4
5
5
struct TodoListContainer : ConnectableView {
6
- @Environment ( \. horizontalSizeClass) var sizeClass
7
- @MappedDispatch ( ) private var dispatch
8
- @State private var editMode : EditMode = . inactive
6
+ var id : String
9
7
10
- public var id : String
8
+ @Environment ( \. horizontalSizeClass) private var sizeClass
9
+ @MappedDispatch ( ) private var dispatch
11
10
12
11
func map( state: AppState ) -> [ String ] ? {
13
12
state. todoLists [ id] ? . todoIds
You can’t perform that action at this time.
0 commit comments