A protocol that 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.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pointfreeco/swift-composable-architecture/llms.txt
Use this file to discover all available pages before exploring further.
Protocol Definition
Associated Types
A type that holds the current state of the reducer.
A type that holds all possible actions that cause the
State of the reducer to change and/or kick off a side Effect that can communicate with the outside world.A type representing the body of this reducer. When you create a custom reducer by implementing the
body property, Swift infers this type from the value returned. If you create a custom reducer by implementing reduce(into:action:), Swift infers this type to be Never.Properties
The content and behavior of a reducer that is composed from other reducers. In the body of a reducer one can compose many reducers together, which will be run in order, from top to bottom.
Methods
Usage
Define a reducer by conforming to theReducer protocol and implementing the body property:
Composing Reducers
Reducers can be composed together in thebody using reducer operations:
Type Aliases
A convenience for constraining a This allows you to specify the Instead of the more verbose:
Reducer conformance:body of a Reducer conformance like: