Skip to content

ethiffeault/etsm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version

etsm

Efficient Tiny State Machine using object callbacks. Implemented in many languages.

Description

Implement a bare bones state machine in many languages. This library aim to be simple as possible and support only basic features:

  • states on object (owner)
  • optional enter/exit methods
  • virtual state user methods
  • is in
  • unrestricted transitions
  • no runtime allocation

Languages

Why

For small and simple state machine needs. Source code for each language is very small, easy to copy/paste...
Also because it's funny to see how a little bit of code can be different from language to language.

Install

Depend on the language, etsm is designed to be a one file dropper in your project. But a package might also be available.