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

.. js:class:: wv.Util.StateMachine

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



.. rst-class:: kind-group kind-constructors

.. rubric:: Constructors
   :class: kind-group-title


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

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



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: wv.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*
      




