StateMachine

class Util.StateMachine()

StateMachine<State, ActionNames> is a minimalist state machine

Index

Constructors

Methods

Constructors

Util.StateMachine.constructor()
StateMachine(state: State, reducer: StateReducer<State, ActionNames>): StateMachine<State, ActionNames>

Parameters

state: State

reducer: StateReducer<State, ActionNames>

Returns: StateMachine<State, ActionNames>

Methods

Util.StateMachine.handle()
handle(evt: ActionNames, payload: any): void

Handle an action and update the state

Parameters

evt: ActionNames

The action to handle

payload: any

The payload if any

Returns: void