PROTOCOL
WorkflowAction
¶
public protocol WorkflowAction<WorkflowType>
Conforming types represent an action that advances a workflow. When applied, an action emits the next state and / or output for the workflow.
Methods¶
apply(toState:)
¶
func apply(toState state: inout WorkflowType.State) -> WorkflowType.Output?
Applies this action to a given state of the workflow, optionally returning an output event.
-
Parameter state: The current state of the workflow. The state is passed as an
inout
param, allowing actions to modify state during application. -
Returns: An optional output event for the workflow. If an output event is returned, it will be passed up the workflow hierarchy to this workflow’s parent.
Parameters¶
Name | Description |
---|---|
state | The current state of the workflow. The state is passed as an inout param, allowing actions to modify state during application. |