Skip to content

//workflow/com.squareup.workflow1/StatefulWorkflow/StatefulWorkflow

StatefulWorkflow

[jvm]
Content
fun StatefulWorkflow()
More info

Parameters

jvm

PropsT

Typically a data class that is used to pass configuration information or bits of state that the workflow can always get from its parent and needn’t duplicate in its own state. May be Unit if the workflow does not need any props data.

StateT

Typically a data class that contains all of the internal state for this workflow. The state is seeded via props in initialState. It can be serialized and later used to restore the workflow. Implementations of the Workflow interface should not generally contain their own state directly. They may inject objects like instances of their child workflows, or network clients, but should not contain directly mutable state. This is the only type parameter that a parent workflow needn’t care about for its children, and may just use star (*) instead of specifying it. May be Unit if the workflow does not have any internal state (see StatelessWorkflow).

OutputT

Typically a sealed class that represents “events” that this workflow can send to its parent. May be Nothing if the workflow doesn’t need to emit anything.

RenderingT

The value returned to this workflow’s parent during composition. Typically represents a “view” of this workflow’s props, current state, and children’s renderings. A workflow that represents a UI component may use a view model as its rendering type.