Skip to main content
100%

Generated by XState Viz: https://xstate.js.org/viz

✓ Published0🌍 Public
Aafbroman
Last edited Aug 3, 2020
Created on Aug 3, 2020

This example shows a finite-state machine for a light switch with a hidden mode and history state, visualized interactively. The machine defines states for hidden, visible (with light and dark substates), and a history pseudo-state that restores the last active substate. It uses the XState library’s `Machine` API to declare transitions like `TURN_ON` and `SWITCH`, and the visualization is rendered by XState Viz, which parses the JavaScript machine definition to generate a live statechart diagram. The code includes no external data sources, only the machine’s transition logic.

AI-generated description

Similar vizzes