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
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.

Action​Sheet​State

A data type that describes the state of an action sheet 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.

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
Binding​Action

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

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.

Test​Store.​Step

A single step of a TestStore assertion.

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(prefix:state:action:environment:) higher-order reducer.

Alert​State.​Button.​`Type`

Protocols

Custom​Debug​Output​Convertible

Typealiases

Form​Action

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

Date
LocalizedStringKey
Publisher
String
Text
URL
View