legacy-workflow-rx2 / com.squareup.workflow.legacy.rx2 / com.squareup.workflow.legacy.Workflow

Extensions for com.squareup.workflow.legacy.Workflow

result

Called with the final result of this workflow. The result value should be cached – that is, the result should be stored and emitted even if the Maybe isn't subscribed to until after the workflow completes. It should also support multiple subscribers.

val <O : Any> Workflow<*, *, O>.result: Maybe<out O>

state

On every update, reports the complete, current state of this workflow.

val <S : Any> Workflow<S, *, *>.state: Observable<out S>

switchMapState

Like mapState, transforms the receiving workflow with Workflow.state of type S1 to one with states of S2. Unlike that method, each S1 update is transformed into a stream of S2 updates -- useful when an S1 state might wrap an underlying workflow whose own screens need to be shown.

fun <S1 : Any, S2 : Any, E : Any, O : Any> Workflow<S1, E, O>.switchMapState(transform: (S1) -> Observable<out S2>): Workflow<S2, E, O>

toCompletable

Returns a Completable that fires either when Workflow.result fires, or when Workflow.cancel is called.

fun Workflow<*, *, *>.toCompletable(): Completable