uniflow-core / io.uniflow.core.flow / DataFlow

DataFlow

interface DataFlow

Unidirectional Data Flow

A component that is able to declare new action, and dispatch to an internal reducer processor

ActionDispatcher - Have at least one DataPublisher, to publish State/Event data

onError - default error handling behavior that can be overloaded

Author
Arnaud Giuliani

Properties

actionDispatcher

abstract val actionDispatcher: ActionDispatcher

coroutineScope

abstract val coroutineScope: CoroutineScope

tag

abstract val tag: String

Functions

action

open fun action(onAction: ActionFunction): Action
open fun action(onAction: ActionFunction, onError: ActionErrorFunction): Action

defaultPublisher

abstract fun defaultPublisher(): DataPublisher

onError

open suspend fun onError(error: Exception, currentState: UIState): Unit

Extension Functions

actionOn

fun <T : UIState> DataFlow.actionOn(onAction: ActionFunction_T<T>): Action
fun <T : UIState> DataFlow.actionOn(onAction: ActionFunction_T<T>, onError: ActionErrorFunction_T<T>): Action