.. role:: ts-api-decorator

############
StateMachine
############

.. js:module:: Util
   :noindex:

.. container:: ts-api-section

   .. js:class:: StateMachine

      StateMachine<State, ActionNames> is a minimalist state machine



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~Util.StateMachine.constructor`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~Util.StateMachine.handle`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: StateMachine.constructor( state, reducer)

      :param state: None
      :type state: State
      :param reducer: None
      :type reducer: StateReducer <State, ActionNames>


      :rtype: StateMachine <State, ActionNames>



Methods
=======

.. rst-class:: ts-api-section

handle
------

.. js:method:: StateMachine.handle( evt[, payload])

   :param evt: The action to handle
   :type evt: ActionNames
   :param payload: :ts-api-decorator:`optional` The payload if any
   :type payload: any


   Handle an action and update the state


   :rtype: void

