Skip to content

AFSM

Decorator-driven async state machines — change state in one line

TypeScript ESM Decorators Mermaid
01

Decorator-driven

Wrap async methods with @ChangeState and other decorators to auto-manage transitions and intermediate states.

02

Visual state diagrams

Auto-generates mermaid stateDiagram-v2 so you can observe the topology and transitions live.

03

Composition & interruption

Compose multiple FSMs via context, abort in-flight MiddleStates, sync mode, and inheritance.

04

DevTools extension

Companion Chrome / Edge DevTools panel to inspect running state machines and their history.

Install & usage →

Try it live

Here’s the “traffic light” example — it auto-runs: