Skip to content

//workflow/com.squareup.workflow1/Workflow/Companion

Companion

[jvm] object Companion

Empty companion serves as a hook point to allow us to create Workflow.foo extension methods elsewhere.

Extensions

Name Summary
rendering [jvm]
Content
fun <RenderingT> Workflow.Companion.rendering(rendering: RenderingT): Workflow<Unit, Nothing, RenderingT>
More info
Returns a workflow that does nothing but echo the given rendering.


stateful [jvm]
Content
inline fun <PropsT, StateT, OutputT, RenderingT> Workflow.Companion.stateful(crossinline initialState: (PropsT, Snapshot?) -> StateT, crossinline render: BaseRenderContext<PropsT, StateT, OutputT>.(PropsT, StateT) -> RenderingT, crossinline snapshot: (StateT) -> Snapshot?, crossinline onPropsChanged: (PropsT, PropsT, StateT) -> StateT = { _, _, state -> state }): StatefulWorkflow<PropsT, StateT, OutputT, RenderingT>
inline fun <PropsT, StateT, OutputT, RenderingT> Workflow.Companion.stateful(crossinline initialState: (PropsT) -> StateT, crossinline render: BaseRenderContext<PropsT, StateT, OutputT>.(PropsT, StateT) -> RenderingT, crossinline onPropsChanged: (PropsT, PropsT, StateT) -> StateT = { _, _, state -> state }): StatefulWorkflow<PropsT, StateT, OutputT, RenderingT>
More info
Returns a stateful Workflow implemented via the given functions.


[jvm]
Content
inline fun <StateT, OutputT, RenderingT> Workflow.Companion.stateful(crossinline initialState: (Snapshot?) -> StateT, crossinline render: BaseRenderContext<Unit, StateT, OutputT>.(StateT) -> RenderingT, crossinline snapshot: (StateT) -> Snapshot?): StatefulWorkflow<Unit, StateT, OutputT, RenderingT>
More info
Returns a stateful Workflow, with no props, implemented via the given functions.


[jvm]
Content
inline fun <StateT, OutputT, RenderingT> Workflow.Companion.stateful(initialState: StateT, crossinline render: BaseRenderContext<Unit, StateT, OutputT>.(StateT) -> RenderingT): StatefulWorkflow<Unit, StateT, OutputT, RenderingT>
More info
Returns a stateful Workflow, with no props, implemented via the given function.


stateless [jvm]
Content
inline fun <PropsT, OutputT, RenderingT> Workflow.Companion.stateless(crossinline render: BaseRenderContext<PropsT, Nothing, OutputT>.(PropsT) -> RenderingT): Workflow<PropsT, OutputT, RenderingT>
More info
Returns a stateless Workflow via the given render function.