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

.. js:class:: Util.StateMachine

   StateMachine<State, ActionNames> is a minimalist state machine
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~Util.StateMachine.constructor`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~Util.StateMachine.handle`
   
   




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

.. js:method:: Util.StateMachine.constructor

   .. rst-class:: sig-pretty-signature
   
      | StateMachine(**state**\ : State, **reducer**\ : :js:data:`StateReducer <Util.StateReducer>`\ <State, ActionNames>): :js:class:`StateMachine <Util.StateMachine>`\ <State, ActionNames>
   
   **Parameters**
   
      **state**\ : State
   
      **reducer**\ : :js:data:`StateReducer <Util.StateReducer>`\ <State, ActionNames>
   
   
   **Returns**\ : :js:class:`StateMachine <Util.StateMachine>`\ <State, ActionNames>
   





Methods
=======

.. js:method:: Util.StateMachine.handle

   .. rst-class:: sig-pretty-signature
   
      | 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*
   





