Add named closure arguments (#2295)

* Add named closure arguments

Better for documentation and auto-fill.

* wip
This commit is contained in:
Stephen Celis
2023-07-16 15:27:02 -07:00
committed by GitHub
parent c113ba4f22
commit faadf6a780
22 changed files with 147 additions and 141 deletions

View File

@@ -25,7 +25,7 @@ public struct NavigationStackStore<State, Action, Root: View, Destination: View>
public init(
_ store: Store<StackState<State>, StackAction<State, Action>>,
@ViewBuilder root: () -> Root,
@ViewBuilder destination: @escaping (Store<State, Action>) -> Destination
@ViewBuilder destination: @escaping (_ store: Store<State, Action>) -> Destination
) {
self.root = root()
self.destination = { component in
@@ -62,7 +62,7 @@ public struct NavigationStackStore<State, Action, Root: View, Destination: View>
public init<D: View>(
_ store: Store<StackState<State>, StackAction<State, Action>>,
@ViewBuilder root: () -> Root,
@ViewBuilder destination: @escaping (State) -> D
@ViewBuilder destination: @escaping (_ initialState: State) -> D
) where Destination == SwitchStore<State, Action, D> {
self.root = root()
self.destination = { component in