EXTENSION
WorkflowObserver
public extension WorkflowObserver
Methods
sessionDidBegin(_:)
func sessionDidBegin(
_ session: WorkflowSession
)
Parameters
| Name |
Description |
| session |
The WorkflowSession that began. |
sessionDidEnd(_:)
func sessionDidEnd(
_ session: WorkflowSession
)
Parameters
| Name |
Description |
| session |
The WorkflowSession that ended. |
workflowDidMakeInitialState(_:initialState:session:)
func workflowDidMakeInitialState<WorkflowType: Workflow>(
_ workflow: WorkflowType,
initialState: WorkflowType.State,
session: WorkflowSession
)
Parameters
| Name |
Description |
| workflow |
The Workflow that just produced its initial state. |
| initialState |
The State that was created. |
| session |
The WorkflowSession corresponding to the backing WorkflowNode |
workflowWillRender(_:state:session:)
func workflowWillRender<WorkflowType: Workflow>(
_ workflow: WorkflowType,
state: WorkflowType.State,
session: WorkflowSession
) -> ((WorkflowType.Rendering) -> Void)?
Parameters
| Name |
Description |
| workflow |
The Workflow that is about to be render. |
| state |
The corresponding State that will be used during the render call. |
| session |
The WorkflowSession corresponding to the backing WorkflowNode. |
workflowDidChange(from:to:state:session:)
func workflowDidChange<WorkflowType: Workflow>(
from oldWorkflow: WorkflowType,
to newWorkflow: WorkflowType,
state: WorkflowType.State,
session: WorkflowSession
)
Parameters
| Name |
Description |
| oldWorkflow |
The previous Workflow |
| newWorkflow |
The new Workflow |
| state |
The state the update has occurred. |
| session |
The WorkflowSession corresponding to the backing WorkflowNode. |
workflowDidReceiveAction(_:workflow:session:)
func workflowDidReceiveAction<Action: WorkflowAction>(
_ action: Action,
workflow: Action.WorkflowType,
session: WorkflowSession
)
Parameters
| Name |
Description |
| action |
The action that was received. |
| session |
The WorkflowSession corresponding to the backing WorkflowNode. |
workflowWillApplyAction(_:workflow:state:session:)
func workflowWillApplyAction<Action: WorkflowAction>(
_ action: Action,
workflow: Action.WorkflowType,
state: Action.WorkflowType.State,
session: WorkflowSession
) -> ((Action.WorkflowType.State, Action.WorkflowType.Output?) -> Void)?
Parameters
| Name |
Description |
| action |
The action that will be applied. |
| workflow |
The actionβs corresponding Workflow. |
| state |
The state to which the action will be applied. |
| session |
The WorkflowSession corresponding to the backing WorkflowNode. |