Skip to content

Commit 6ab036a

Browse files
committed
Merge remote-tracking branch 'origin/navigation-beta' into prerelease/1.0
2 parents 3b49fde + 3954b4a commit 6ab036a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Sources/ComposableArchitecture/SwiftUI/NavigationLinkStore.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ public struct NavigationLinkStore<
1616
@ObservedObject var viewStore: ViewStore<Bool, PresentationAction<Action>>
1717
let toDestinationState: (State) -> DestinationState?
1818
let fromDestinationAction: (DestinationAction) -> Action
19-
let action: () -> Void
19+
let onTap: () -> Void
2020
let destination: (Store<DestinationState, DestinationAction>) -> Destination
2121
let label: Label
2222

2323
public init(
2424
_ store: Store<PresentationState<State>, PresentationAction<Action>>,
25-
action: @escaping () -> Void,
25+
onTap: @escaping () -> Void,
2626
@ViewBuilder destination: @escaping (Store<State, Action>) -> Destination,
2727
@ViewBuilder label: () -> Label
2828
) where State == DestinationState, Action == DestinationAction {
@@ -34,16 +34,16 @@ public struct NavigationLinkStore<
3434
)
3535
self.toDestinationState = { $0 }
3636
self.fromDestinationAction = { $0 }
37-
self.action = action
37+
self.onTap = onTap
3838
self.destination = destination
3939
self.label = label()
4040
}
4141

4242
public init(
4343
_ store: Store<PresentationState<State>, PresentationAction<Action>>,
4444
state toDestinationState: @escaping (State) -> DestinationState?,
45-
action fromDestinationAction: @escaping (DestinationAction) -> Action,
46-
action: @escaping () -> Void,
45+
onTap fromDestinationAction: @escaping (DestinationAction) -> Action,
46+
onTap: @escaping () -> Void,
4747
@ViewBuilder destination: @escaping (Store<DestinationState, DestinationAction>) -> Destination,
4848
@ViewBuilder label: () -> Label
4949
) {
@@ -56,15 +56,15 @@ public struct NavigationLinkStore<
5656
)
5757
self.toDestinationState = toDestinationState
5858
self.fromDestinationAction = fromDestinationAction
59-
self.action = action
59+
self.onTap = onTap
6060
self.destination = destination
6161
self.label = label()
6262
}
6363

6464
public init(
6565
_ store: Store<PresentationState<State>, PresentationAction<Action>>,
6666
id: State.ID,
67-
action: @escaping () -> Void,
67+
onTap: @escaping () -> Void,
6868
@ViewBuilder destination: @escaping (Store<State, Action>) -> Destination,
6969
@ViewBuilder label: () -> Label
7070
) where State == DestinationState, Action == DestinationAction, State: Identifiable {
@@ -76,7 +76,7 @@ public struct NavigationLinkStore<
7676
)
7777
self.toDestinationState = { $0 }
7878
self.fromDestinationAction = { $0 }
79-
self.action = action
79+
self.onTap = onTap
8080
self.destination = destination
8181
self.label = label()
8282
}
@@ -99,7 +99,7 @@ public struct NavigationLinkStore<
9999
)
100100
self.toDestinationState = toDestinationState
101101
self.fromDestinationAction = fromDestinationAction
102-
self.action = action
102+
self.onTap = action
103103
self.destination = destination
104104
self.label = label()
105105
}
@@ -111,7 +111,7 @@ public struct NavigationLinkStore<
111111
get: { self.viewStore.state },
112112
set: {
113113
if $0 {
114-
self.action()
114+
self.onTap()
115115
} else {
116116
self.viewStore.send(.dismiss)
117117
}

0 commit comments

Comments
 (0)