Skip to main content
100%

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

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

This example shows a state machine for a lamp with hidden and visible modes, where the visible state runs two parallel substates for color mode (light or dark) and brightness (bright or dim). The machine, defined with XState’s `Machine()` factory, transitions between states on events like `TURN_ON`, `TURN_OFF`, and `SWITCH`, while the bright state automatically dims after a 5000-millisecond delay defined in the `delays` option. The visualization, generated by XState Viz, renders the statechart diagram directly from the JavaScript object, highlighting the parallel regions and timed transition.

AI-generated description

Similar vizzes