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 <stephen.celis@gmail.com>
This commit is contained in:
Steven Sherry
2021-03-06 11:16:32 -06:00
committed by GitHub
parent e935270972
commit a116fff6d4

View File

@@ -14,7 +14,7 @@ import Foundation
///
/// This domain can be pulled back to a larger domain with the `forEach` method:
///
/// struct AppState { var counters = IdentifiedArray<Int>(id: \.self) }
/// struct AppState { var counters = IdentifiedArrayOf<CounterState>() }
/// enum AppAction { case counter(id: UUID, action: CounterAction) }
/// let appReducer = counterReducer.forEach(
/// state: \AppState.counters,
@@ -30,7 +30,7 @@ import Foundation
/// var body: some View {
/// List {
/// ForEachStore(
/// self.store.scope(state: \.counters, action: AppAction.counter(id:action))
/// self.store.scope(state: \.counters, action: AppAction.counter(id:action:)),
/// content: CounterView.init(store:)
/// )
/// }