Files
2024-08-02 09:31:06 -04:00

39 lines
663 B
Swift

import ComposableArchitecture
import SwiftUI
@Reducer
struct App {
// ...
}
struct AppView: View {
@Bindable var store: StoreOf<App>
var body: some View {
NavigationStack(
path: $store.scope(state: \.path, action: \.path)
) {
SyncUpsListView(
store: store.scope(state: \.syncUpsList, action: \.syncUpsList)
)
} destination: { store in
switch store.case {
case let .detail(detailStore):
SyncUpDetailView(store: detailStore)
}
}
}
}
#Preview {
AppView(
store: Store(
initialState: App.State(
syncUpsList: SyncUpsList.State()
)
) {
App()
}
)
}