uniflow-core / io.uniflow.core.flow / ActionDispatcher

ActionDispatcher

class ActionDispatcher

Handle dispatch logic to ActionReducer, help wrap Action dispatchAction - Help dispatch given action to ActionReducer, on given coroutineScope context. actionOn - Handle default error behavior by routing back to ::onError function

dispatch will be done in background

Author
Arnaud Giuliani

Constructors

<init>

ActionDispatcher(reducer: ActionReducer, runError: suspend (Exception, UIState) -> Unit, tag: String)

Handle dispatch logic to ActionReducer, help wrap Action dispatchAction - Help dispatch given action to ActionReducer, on given coroutineScope context. actionOn - Handle default error behavior by routing back to ::onError function

Properties

tag

val tag: String

Functions

actionOn

fun actionOn(kClass: KClass<out UIState>, onAction: ActionFunction): Unit
fun actionOn(kClass: KClass<out UIState>, onAction: ActionFunction, onError: ActionErrorFunction): Unit

close

fun close(): Unit

dispatchAction

fun dispatchAction(onAction: ActionFunction): Unit
fun dispatchAction(onAction: ActionFunction, onError: ActionErrorFunction): Unit
fun dispatchAction(action: Action): Unit