Skip to content

Commit a116fff

Browse files
Addresses a couple of documentation issues for IdentifiedArray (#414)
* Addresses a couple of documentation issues for IdentifiedArray: 1. The AppState example is missing a generic. Based on the context of the documentation, I filled that into what I thought would be appropriate. 2. The ForEachStore example was missing a colon and comma. * Update Sources/ComposableArchitecture/SwiftUI/IdentifiedArray.swift Co-authored-by: Stephen Celis <[email protected]>
1 parent e935270 commit a116fff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/ComposableArchitecture/SwiftUI/IdentifiedArray.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Foundation
1414
///
1515
/// This domain can be pulled back to a larger domain with the `forEach` method:
1616
///
17-
/// struct AppState { var counters = IdentifiedArray<Int>(id: \.self) }
17+
/// struct AppState { var counters = IdentifiedArrayOf<CounterState>() }
1818
/// enum AppAction { case counter(id: UUID, action: CounterAction) }
1919
/// let appReducer = counterReducer.forEach(
2020
/// state: \AppState.counters,
@@ -30,7 +30,7 @@ import Foundation
3030
/// var body: some View {
3131
/// List {
3232
/// ForEachStore(
33-
/// self.store.scope(state: \.counters, action: AppAction.counter(id:action))
33+
/// self.store.scope(state: \.counters, action: AppAction.counter(id:action:)),
3434
/// content: CounterView.init(store:)
3535
/// )
3636
/// }

0 commit comments

Comments
 (0)