Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Sources/ComposableArchitecture/SwiftUI/ForEachStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,19 @@ import SwiftUI
/// state:
///
/// ```swift
/// struct Todos: ReducerProtocol { {
/// struct Todos: ReducerProtocol {
/// struct State: Equatable {
/// var todos: IdentifiedArrayOf<TodoState> = []
/// var todos: IdentifiedArrayOf<Todo.State> = []
/// }
/// ...
/// }
/// ```
///
/// Define a case to handle actions sent to the child domain:
///
/// ```swift
/// enum Action {
/// case todo(id: TodoState.ID, action: TodoAction)
/// case todo(id: Todo.State.ID, action: Todo.Action)
/// }
/// ```
///
Expand All @@ -61,7 +63,7 @@ import SwiftUI
/// Reduce { state, action in
/// ...
/// }
/// .forEach(state: \.todos, action: /Action.todo(id:action:)) {
/// .forEach(\.todos, action: /Action.todo(id:action:)) {
/// Todo()
/// }
/// }
Expand Down