RenderContext

Properties

Link copied to clipboard

Accepts a single WorkflowAction, invokes that action by calling WorkflowAction.apply to update the current state, and optionally emits the returned output value if it is non-null.

Functions

Link copied to clipboard
open override fun <E1, E2, E3, E4, E5, E6, E7, E8, E9> eventHandler(name: () -> String, update: WorkflowAction.Updater<@UnsafeVariance PropsT, Nothing, @UnsafeVariance OutputT>.(E1, E2, E3, E4, E5, E6, E7, E8, E9) -> Unit): (E1, E2, E3, E4, E5, E6, E7, E8, E9) -> Unit
open override fun <E1, E2, E3, E4, E5, E6, E7, E8, E9, E10> eventHandler(name: () -> String, update: WorkflowAction.Updater<@UnsafeVariance PropsT, Nothing, @UnsafeVariance OutputT>.(E1, E2, E3, E4, E5, E6, E7, E8, E9, E10) -> Unit): (E1, E2, E3, E4, E5, E6, E7, E8, E9, E10) -> Unit
open override fun <E1, E2> eventHandler(name: () -> String, update: WorkflowAction.Updater<@UnsafeVariance PropsT, Nothing, @UnsafeVariance OutputT>.(E1, E2) -> Unit): (E1, E2) -> Unit
open override fun <E1, E2, E3> eventHandler(name: () -> String, update: WorkflowAction.Updater<@UnsafeVariance PropsT, Nothing, @UnsafeVariance OutputT>.(E1, E2, E3) -> Unit): (E1, E2, E3) -> Unit
open override fun <E1, E2, E3, E4> eventHandler(name: () -> String, update: WorkflowAction.Updater<@UnsafeVariance PropsT, Nothing, @UnsafeVariance OutputT>.(E1, E2, E3, E4) -> Unit): (E1, E2, E3, E4) -> Unit
open override fun <E1, E2, E3, E4, E5> eventHandler(name: () -> String, update: WorkflowAction.Updater<@UnsafeVariance PropsT, Nothing, @UnsafeVariance OutputT>.(E1, E2, E3, E4, E5) -> Unit): (E1, E2, E3, E4, E5) -> Unit
open override fun <E1, E2, E3, E4, E5, E6> eventHandler(name: () -> String, update: WorkflowAction.Updater<@UnsafeVariance PropsT, Nothing, @UnsafeVariance OutputT>.(E1, E2, E3, E4, E5, E6) -> Unit): (E1, E2, E3, E4, E5, E6) -> Unit
open override fun <E1, E2, E3, E4, E5, E6, E7> eventHandler(name: () -> String, update: WorkflowAction.Updater<@UnsafeVariance PropsT, Nothing, @UnsafeVariance OutputT>.(E1, E2, E3, E4, E5, E6, E7) -> Unit): (E1, E2, E3, E4, E5, E6, E7) -> Unit
open override fun <E1, E2, E3, E4, E5, E6, E7, E8> eventHandler(name: () -> String, update: WorkflowAction.Updater<@UnsafeVariance PropsT, Nothing, @UnsafeVariance OutputT>.(E1, E2, E3, E4, E5, E6, E7, E8) -> Unit): (E1, E2, E3, E4, E5, E6, E7, E8) -> Unit

open override fun eventHandler(name: () -> String, update: WorkflowAction.Updater<@UnsafeVariance PropsT, Nothing, @UnsafeVariance OutputT>.() -> Unit): () -> Unit

Creates a function which builds a WorkflowAction from the given update function, and immediately passes it to actionSink. Handy for attaching event handlers to renderings.

Link copied to clipboard

Ensures child is running as a child of this workflow, and returns the result of its render method.

Link copied to clipboard
Link copied to clipboard
open override fun runningSideEffect(key: String, sideEffect: suspend CoroutineScope.() -> Unit)

Ensures sideEffect is running with the given key.

Link copied to clipboard

Ensures a LifecycleWorker is running. Since worker can't emit anything, it can't trigger any WorkflowActions.

inline fun <T, W : Worker<T>, PropsT, StateT, OutputT> BaseRenderContext<PropsT, StateT, OutputT>.runningWorker(worker: W, key: String = "", noinline handler: (T) -> WorkflowAction<PropsT, StateT, OutputT>)

Ensures worker is running. When the Worker emits an output, handler is called to determine the WorkflowAction to take. When the worker finishes, nothing happens (although another render pass may be triggered).