You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What would be an example/best practices on how handle a string deeplink?
public struct App: ReducerProtocol {
public struct State: Equatable {
var path = StackState<Path.State>()
}
public enum Action: Equatable {
case path(StackAction<Path.State, Path.Action>)
case deeplink(String)
}
public var body: some ReducerProtocolOf<Self> {
Reduce<State, Action> { state, action in
switch action {
case .deeplink(let deeplink):
// Handle deeplink.
default:
return .none
}
}.forEach(\.path, action: /Action.path, destination: Path.init)
}
public struct Path: ReducerProtocol {
public enum State: Equatable {
case screenA(ScreenA.State)
case screenB(ScreenB.State)
}
public enum Action: Equatable {
case screenA(ScreenA.Action)
case screenB(ScreenB.Action)
}
public var body: some ReducerProtocolOf<Self> {
Scope(state: /State.screenA, action: /Action.screenA, child: ScreenA.init)
Scope(state: /State.screenB, action: /Action.screenB, child: ScreenB.init)
}
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
What would be an example/best practices on how handle a string deeplink?
Beta Was this translation helpful? Give feedback.
All reactions