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
abstract val actionDispatcher: ActionDispatcher |
|
abstract val coroutineScope: CoroutineScope |
|
abstract val tag: String |
open fun action(onAction: ActionFunction): Unitopen fun action(onAction: ActionFunction, onError: ActionErrorFunction): Unit |
|
abstract fun defaultPublisher(): DataPublisher |
|
open suspend fun onError(error: Exception, currentState: UIState): Unit |
fun <T : UIState> DataFlow.actionOn(onAction: ActionFunction_T<T>): Unitfun <T : UIState> DataFlow.actionOn(onAction: ActionFunction_T<T>, onError: ActionErrorFunction_T<T>): Unit |
|
fun <T> DataFlow.onFlow(flow: () -> Flow<T>, doAction: suspend UIState.(T) -> Unit): Jobfun <T> DataFlow.onFlow(flow: () -> Flow<T>, doAction: suspend UIState.(T) -> Unit, onError: ActionErrorFunction): Job |