Package-level declarations

Types

Link copied to clipboard
abstract class Action

An action that can be dispatched to the StateMachine.

Link copied to clipboard
abstract class Effect

An effect that can be dispatched to the StateMachine.

Link copied to clipboard
fun interface EffectHandle<S : State, A : Action, E : Effect>

Handles the effect triggered after a state transition.

Link copied to clipboard
fun interface FallbackHandle<S : State, A : Action, E : Effect>

Handles unhandled exception that occur during a state transition or handling an effect.

Link copied to clipboard
class Graph<S : State, A : Action, E : Effect>(val edges: Map<KClass<S>, Map<KClass<A>, (prev: S, action: A) -> Transition<S, E>>>)

A graph that represents the state machine.

Link copied to clipboard
Link copied to clipboard
abstract class State

A state that can be stored in the StateMachine. State must override equals and hashCode to be used as data objects.

Link copied to clipboard
abstract class StateMachine<S : State, A : Action, E : Effect>(initialState: S, val graph: Graph<S, A, E>, val effectHandle: EffectHandle<S, A, E>, val fallbackHandle: FallbackHandle<S, A, E>? = null, val logger: Logger = NoopLogger, val context: CoroutineContext = EmptyCoroutineContext)
Link copied to clipboard
class Transition<S : State, E : Effect>