Skip to content

Commit afa5ce4

Browse files
committed
Cleanup
1 parent e78b04e commit afa5ce4

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

Todo/Containers/NewTodoContainer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import Combine
33
import SwiftDux
44

55
struct NewTodoContainer : ConnectableView {
6-
@MappedDispatch() private var dispatch
7-
86
var id: String
97

8+
@MappedDispatch() private var dispatch
9+
1010
func map(state: AppState, binder: StateBinder) -> Binding<String>? {
1111
guard let todoList = state.todoLists[id] else { return nil }
1212
return binder.bind(todoList.newTodoText) {

Todo/Containers/TodoContainer.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import SwiftDux
33
import Combine
44

55
struct TodoContainer : ConnectableView {
6-
76
var todoListId: String
87
var todoId: String
98

Todo/Containers/TodoListBrowserContainer.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ import SwiftDux
33
import Combine
44

55
struct TodoListBrowserContainer : ConnectableView {
6-
7-
// struct Props: Equatable {
8-
// var todoLists: OrderedState<TodoList>
9-
// var selectedTodoListId: String?
10-
// }
11-
126
@Environment(\.horizontalSizeClass) private var sizeClass
137
@MappedDispatch() private var dispatch
148

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+
)
1719
}
1820

1921
func body(props: Props) -> some View {

Todo/Containers/TodoListContainer.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import Combine
33
import SwiftDux
44

55
struct TodoListContainer : ConnectableView {
6-
@Environment(\.horizontalSizeClass) var sizeClass
7-
@MappedDispatch() private var dispatch
8-
@State private var editMode: EditMode = .inactive
6+
var id: String
97

10-
public var id: String
8+
@Environment(\.horizontalSizeClass) private var sizeClass
9+
@MappedDispatch() private var dispatch
1110

1211
func map(state: AppState) -> [String]? {
1312
state.todoLists[id]?.todoIds

0 commit comments

Comments
 (0)