Loading...
Loading...
Expert guidance on The Composable Architecture (TCA) for Swift, focusing on ReducerProtocol, macros, and testability.
npx skill4agent add tryswift/try-swift-tokyo tca@ReducerCasePathsBindablePulsarCasePathdelegateviewinternalcase view(ViewAction)case delegate(DelegateAction)case internal(InternalAction)@Dependency(\.clientName)testValuepreviewValue.run { send in ... }Effect.task.cancellable(id:)TestStorestore.exhaustivity = .onwithDependencies@Reducer
struct Feature {
@ObservableState
struct State: Equatable {
var count = 0
}
enum Action {
case view(ViewAction)
case internal(InternalAction)
enum ViewAction {
case incrementButtonTapped
}
enum InternalAction {
case loadResponse(Int)
}
}
var body: some ReducerOf<Self> {
Reduce { state, action in
switch action {
case .view(.incrementButtonTapped):
state.count += 1
return .none
}
}
}
}