Structs
The following structs are available globally.
-
This is Swift Flow’s built in action type, it is the only built in type that conforms to the
Action
protocol.StandardAction
can be serialized and can therefore be used with developer tools that restore state between app launches.The downside of
StandardAction
is that it carries its payload as an untyped dictionary which does not play well with Swift’s type system.It is recommended that you define your own types that conform to
See moreAction
- if you want to be able to serialize your custom action types, you can implementStandardActionConvertible
which will make it possible to generate aStanardAction
from your typed action - the best of both worlds!Declaration
Swift
public struct StandardAction: Action
-
A Reducer that combines multiple reducers into one. You will typically use this reducer during initial store setup:
let reducer = CombinedReducer([IncreaseByOneReducer(), IncreaseByTwoReducer()]) MainStore(reducer: reducer, appState: CounterState())
The order of the reducers in the array is the order in which the reducers will be invoked.
See moreDeclaration
Swift
public struct CombinedReducer: AnyReducer