Skip to content

Commit 3954b4a

Browse files
committed
renamed action to onTap
1 parent 7b9759d commit 3954b4a

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 {
@@ -31,16 +31,16 @@ public struct NavigationLinkStore<
3131
self.viewStore = ViewStore(filteredStore.scope(state: { $0.wrappedValue != nil }))
3232
self.toDestinationState = { $0 }
3333
self.fromDestinationAction = { $0 }
34-
self.action = action
34+
self.onTap = onTap
3535
self.destination = destination
3636
self.label = label()
3737
}
3838

3939
public init(
4040
_ store: Store<PresentationState<State>, PresentationAction<Action>>,
4141
state toDestinationState: @escaping (State) -> DestinationState?,
42-
action fromDestinationAction: @escaping (DestinationAction) -> Action,
43-
action: @escaping () -> Void,
42+
onTap fromDestinationAction: @escaping (DestinationAction) -> Action,
43+
onTap: @escaping () -> Void,
4444
@ViewBuilder destination: @escaping (Store<DestinationState, DestinationAction>) -> Destination,
4545
@ViewBuilder label: () -> Label
4646
) {
@@ -52,15 +52,15 @@ public struct NavigationLinkStore<
5252
)
5353
self.toDestinationState = toDestinationState
5454
self.fromDestinationAction = fromDestinationAction
55-
self.action = action
55+
self.onTap = onTap
5656
self.destination = destination
5757
self.label = label()
5858
}
5959

6060
public init(
6161
_ store: Store<PresentationState<State>, PresentationAction<Action>>,
6262
id: State.ID,
63-
action: @escaping () -> Void,
63+
onTap: @escaping () -> Void,
6464
@ViewBuilder destination: @escaping (Store<State, Action>) -> Destination,
6565
@ViewBuilder label: () -> Label
6666
) where State == DestinationState, Action == DestinationAction, State: Identifiable {
@@ -69,7 +69,7 @@ public struct NavigationLinkStore<
6969
self.viewStore = ViewStore(filteredStore.scope(state: { $0.wrappedValue?.id == id }))
7070
self.toDestinationState = { $0 }
7171
self.fromDestinationAction = { $0 }
72-
self.action = action
72+
self.onTap = onTap
7373
self.destination = destination
7474
self.label = label()
7575
}
@@ -91,7 +91,7 @@ public struct NavigationLinkStore<
9191
)
9292
self.toDestinationState = toDestinationState
9393
self.fromDestinationAction = fromDestinationAction
94-
self.action = action
94+
self.onTap = action
9595
self.destination = destination
9696
self.label = label()
9797
}
@@ -103,7 +103,7 @@ public struct NavigationLinkStore<
103103
get: { self.viewStore.state },
104104
set: {
105105
if $0 {
106-
self.action()
106+
self.onTap()
107107
} else {
108108
self.viewStore.send(.dismiss)
109109
}

0 commit comments

Comments
 (0)