Companion

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

Functions

Link copied to clipboard

Returns a workflow that does nothing but echo the given rendering. Handy for testing.

Link copied to clipboard
inline fun <StateT, OutputT, RenderingT> Workflow.Companion.sessionWorkflow(crossinline initialState: (CoroutineScope) -> StateT, crossinline render: BaseRenderContext<Unit, StateT, OutputT>.(state: StateT) -> RenderingT): SessionWorkflow<Unit, StateT, OutputT, RenderingT>

Returns a SessionWorkflow, with no props, implemented via the given function.

inline fun <PropsT, StateT, OutputT, RenderingT> Workflow.Companion.sessionWorkflow(crossinline initialState: (PropsT, CoroutineScope) -> StateT, crossinline render: BaseRenderContext<PropsT, StateT, OutputT>.(props: PropsT, state: StateT) -> RenderingT, crossinline onPropsChanged: (old: PropsT, new: PropsT, state: StateT) -> StateT = { _, _, state -> state }): SessionWorkflow<PropsT, StateT, OutputT, RenderingT>
inline fun <PropsT, StateT, OutputT, RenderingT> Workflow.Companion.sessionWorkflow(crossinline initialState: (PropsT, Snapshot?, CoroutineScope) -> StateT, crossinline render: BaseRenderContext<PropsT, StateT, OutputT>.(props: PropsT, state: StateT) -> RenderingT, crossinline snapshot: (StateT) -> Snapshot?, crossinline onPropsChanged: (old: PropsT, new: PropsT, state: StateT) -> StateT = { _, _, state -> state }): SessionWorkflow<PropsT, StateT, OutputT, RenderingT>

Returns a SessionWorkflow implemented via the given functions.

inline fun <StateT, OutputT, RenderingT> Workflow.Companion.sessionWorkflow(crossinline initialState: (Snapshot?, CoroutineScope) -> StateT, crossinline render: BaseRenderContext<Unit, StateT, OutputT>.(state: StateT) -> RenderingT, crossinline snapshot: (StateT) -> Snapshot?): SessionWorkflow<Unit, StateT, OutputT, RenderingT>

Returns a SessionWorkflow, with no props, implemented via the given functions.

Link copied to clipboard

Returns a stateful Workflow, with no props, implemented via the given function.

inline fun <PropsT, StateT, OutputT, RenderingT> Workflow.Companion.stateful(crossinline initialState: (PropsT) -> StateT, crossinline render: BaseRenderContext<PropsT, StateT, OutputT>.(props: PropsT, state: StateT) -> RenderingT, crossinline onPropsChanged: (old: PropsT, new: PropsT, state: StateT) -> StateT = { _, _, state -> state }): StatefulWorkflow<PropsT, StateT, OutputT, RenderingT>
inline fun <PropsT, StateT, OutputT, RenderingT> Workflow.Companion.stateful(crossinline initialState: (PropsT, Snapshot?) -> StateT, crossinline render: BaseRenderContext<PropsT, StateT, OutputT>.(props: PropsT, state: StateT) -> RenderingT, crossinline snapshot: (StateT) -> Snapshot?, crossinline onPropsChanged: (old: PropsT, new: PropsT, state: StateT) -> StateT = { _, _, state -> state }): StatefulWorkflow<PropsT, StateT, OutputT, RenderingT>

Returns a stateful Workflow implemented via the given functions.

inline fun <StateT, OutputT, RenderingT> Workflow.Companion.stateful(crossinline initialState: (Snapshot?) -> StateT, crossinline render: BaseRenderContext<Unit, StateT, OutputT>.(state: StateT) -> RenderingT, crossinline snapshot: (StateT) -> Snapshot?): StatefulWorkflow<Unit, StateT, OutputT, RenderingT>

Returns a stateful Workflow, with no props, implemented via the given functions.

Link copied to clipboard

Returns a stateless Workflow via the given render function.