import ComposableArchitecture
The Composable Architecture (TCA, for short) is a library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind. It can be used in SwiftUI, UIKit, and more, and on any Apple platform (iOS, macOS, tvOS, and watchOS).
@MainActor convenience init<R>(initialState: @autoclosure () -> R.State, @ReducerBuilder<State, Action> reducer: () -> R, withDependencies prepareDependencies: ((inout DependencyValues) -> Void)? = nil) where State == R.State, Action == R.Action, R : Reducer
Initializes a store from an initial state and a reducer.
@MainActor subscript<ElementState, ElementAction>(fileID fileID: _HashableStaticString, filePath filePath: _HashableStaticString, line line: UInt, column column: UInt) -> StackState<ElementState>.PathView where State == StackState<ElementState>, Action == StackAction<ElementState, ElementAction> { get set }
@MainActor func ifLet<Wrapped>(then unwrap: @escaping (_ store: Store<Wrapped, Action>) -> Void, else: @escaping () -> Void = {}) -> any Cancellable where State == Wrapped?
Calls one of two closures depending on whether a store’s optional state is nil
or not, and whenever this condition changes for as long as the cancellable lives.
@MainActor func scope<ChildState, ChildAction>(id: ScopeID<State, Action>?, state: ToState<State, ChildState>, action fromChildAction: @escaping (ChildAction) -> Action, isInvalid: ((State) -> Bool)?) -> Store<ChildState, ChildAction>
@MainActor func scope<ChildState, ChildAction>(state: KeyPath<State, ChildState>, action: CaseKeyPath<Action, ChildAction>) -> Store<ChildState, ChildAction>
Scopes the store to one that exposes child state and actions.