ComposableArchitecture Documentation

Classes

Store

A store represents the runtime that powers the application. It is the object that you will pass around to views that need to interact with the application.

Test​Store

A testable runtime for a reducer.

View​Store

A ViewStore is an object that can observe state changes and send actions. They are most commonly used in views, such as SwiftUI views, UIView or UIViewController, but they can be used anywhere it makes sense to observe state and send actions.

Structures

Debug​Environment

An environment for debug-printing reducers.

Effect

The Effect type encapsulates a unit of work that can be run in the outside world, and can feed data back to the Store. It is the perfect place to do side effects, such as network requests, saving/loading from disk, creating timers, interacting with dependencies, and more.

Effect.​Subscriber
Test​Store.​Step
Reducer

A reducer describes how to evolve the current state of an application to the next state, given an action, and describes what Effects should be executed later by the store, if any.

Alert​State

A data type that describes the state of an alert that can be shown to the user. The Action generic is the type of actions that can be sent from tapping on a button in the alert.

Alert​State.​Button
Alert​State.​Button​Action
Bindable​State

A property wrapper type that can designate properties of app state that can be directly bindable in SwiftUI views.

Binding​Action

An action that describes simple mutations to some root state at a writable key path.

Confirmation​Dialog​State

A data type that describes the state of a confirmation dialog that can be shown to the user. The Action generic is the type of actions that can be sent from tapping on a button in the sheet.

For​Each​Store

A Composable Architecture-friendly wrapper around ForEach that simplifies working with collections of state.

Identified

A wrapper around a value and a hashable identifier that conforms to identifiable.

IfLet​Store

A view that safely unwraps a store of optional state in order to show one of two views.

Switch​Store

A view that can switch over a store of enum state and handle each case.

Case​Let

A view that handles a specific case of enum state in a SwitchStore.

Default

A view that covers any cases that aren't addressed in a SwitchStore.

_Exhaustivity​Check​View
Text​State

An equatable description of SwiftUI Text. Useful for storing rich text in state for the purpose of rendering in a view hierarchy.

With​View​Store

A structure that transforms a store into an observable view store in order to compute views from store state.

Store​Publisher

A publisher of store state.

Enumerations

Action​Format

Determines how the string description of an action should be printed when using the Reducer/debug(_:state:action:actionFormat:environment:) higher-order reducer.

Alert​State.​Button​Action.​Action​Type
Alert​State.​Button​Role
Confirmation​Dialog​State.​Visibility
Text​State.​Accessibility​Text​Content​Type
Text​State.​Accessibility​Heading​Level

Protocols

Bindable​Action

An action type that exposes a binding case that holds a BindingAction.

Typealiases

Action​Sheet​State

Functions

send(_:​while:​)

Sends an action into the store and then suspends while a piece of state is true.

send(_:​animation:​while:​)

Sends an action into the store and then suspends while a piece of state is true.

suspend(while:​)

Suspends while a predicate on state is true.

Extensions

Publisher
String
Text
View