Graph

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.

example:

val graph = Graph<State, Action, Effect> {
state<InitialState> {
action<InitialAction> { prev, action ->
transition(NextState, NextEffect)
}
action<AnotherAction> { prev, action ->
transition(AnotherState)
}
}
}

Constructors

Link copied to clipboard
constructor(edges: Map<KClass<S>, Map<KClass<A>, (prev: S, action: A) -> Transition<S, E>>>)

Types

Link copied to clipboard
object Companion

Properties

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