Discover Packages
github.com/drakmaniso/old-cozely
x
machine
package
Version:
v0.0.0-...-d322e89
Opens a new window with list of versions in this module.
Published: Oct 14, 2018
License: BSD-2-Clause
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation Source Files Overview Index Constants Variables Functions Types Examples type State (s) Update()
Documentation
¶
Output:
State 1
State 2
State 3
State 2
State 3
State 2
State 3
Output:
State 1
State 2
State 3
State 2
State 3
State 2
State 3
State is used to implement a lightweight state machine. Each state is
represented by a closure, that, when run, returns the next state (or nil to
stop the machine).
Update runs s (i.e. the current state), and replaces it with the result of
that call. It's safe to call Update on a nil target.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.