class Action
Wrap a function that will set a new state or event, regarding current state We can target a specific State KClass to ensure we want to execute on it |
|
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 |
|
open class ActionReducer
Action processor component, backed by a coroutine Actor to execute a queue of Actions |
|
interface DataFlow
Unidirectional Data Flow |
|
interface DataPublisher : StatePublisher, EventPublisher
Component that handle State & Event |
|
interface EventPublisher
Component for Event publishing |
|
interface StatePublisher
Component for State publishing |
typealias ActionErrorFunction = suspend (Exception, UIState) -> Unit |
|
typealias ActionErrorFunction_T<T> = suspend (Exception, T) -> Unit |
|
typealias ActionFunction = suspend (UIState) -> Unit |
|
typealias ActionFunction_T<T> = suspend (T) -> Unit |
fun <T : UIState> DataFlow.actionOn(onAction: ActionFunction_T<T>): Actionfun <T : UIState> DataFlow.actionOn(onAction: ActionFunction_T<T>, onError: ActionErrorFunction_T<T>): Action |
|
suspend fun <T : UIState> StatePublisher.getStateOrNull(): T? |
|
suspend fun <T : UIState> StatePublisher.onState(code: (T) -> Unit): Unit |