Skip to content

Commit 5d490c7

Browse files
authored
Make reducer builder closure parameters explicit (#1897)
- Scope(...:child:) - forEach(...:element:) The one exception is `CombineReducers`, which already includes the `Reducers` in its name.
1 parent c1a1411 commit 5d490c7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/ComposableArchitecture/Reducer/Reducers/ForEachReducer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extension ReducerProtocol {
5353
public func forEach<ElementState, ElementAction, ID: Hashable, Element: ReducerProtocol>(
5454
_ toElementsState: WritableKeyPath<State, IdentifiedArray<ID, ElementState>>,
5555
action toElementAction: CasePath<Action, (ID, ElementAction)>,
56-
@ReducerBuilder<ElementState, ElementAction> _ element: () -> Element,
56+
@ReducerBuilder<ElementState, ElementAction> element: () -> Element,
5757
file: StaticString = #file,
5858
fileID: StaticString = #fileID,
5959
line: UInt = #line

Sources/ComposableArchitecture/Reducer/Reducers/Scope.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public struct Scope<ParentState, ParentAction, Child: ReducerProtocol>: ReducerP
146146
public init<ChildState, ChildAction>(
147147
state toChildState: WritableKeyPath<ParentState, ChildState>,
148148
action toChildAction: CasePath<ParentAction, ChildAction>,
149-
@ReducerBuilder<ChildState, ChildAction> _ child: () -> Child
149+
@ReducerBuilder<ChildState, ChildAction> child: () -> Child
150150
) where ChildState == Child.State, ChildAction == Child.Action {
151151
self.init(
152152
toChildState: .keyPath(toChildState),
@@ -218,7 +218,7 @@ public struct Scope<ParentState, ParentAction, Child: ReducerProtocol>: ReducerP
218218
public init<ChildState, ChildAction>(
219219
state toChildState: CasePath<ParentState, ChildState>,
220220
action toChildAction: CasePath<ParentAction, ChildAction>,
221-
@ReducerBuilder<ChildState, ChildAction> _ child: () -> Child,
221+
@ReducerBuilder<ChildState, ChildAction> child: () -> Child,
222222
file: StaticString = #file,
223223
fileID: StaticString = #fileID,
224224
line: UInt = #line

0 commit comments

Comments
 (0)