Generated by XState Viz: https://xstate.js.org/viz
✓ Published0🌍 Public
TToastbroad
Last edited Apr 20, 2022
Created on Apr 19, 2022
This visualization shows a state machine for a personalized insurance recommendation flow, branching based on a user’s employment status and held insurance policies. It uses XState’s `Machine` API to define nested states such as `isEmployed`, `hasBU`, and `isFullyInsured`, with conditional transitions via `cond` guards that check the `context` object for values like `employmentStatus` and the `insurances` array. The example is rendered as an interactive diagram by XState Viz, allowing viewers to step through the logic by sending `NEXT` events. The machine’s final states—like `hasAV`, `hasLiability`, or `isFullyInsured`—represent the resulting recommendation categories.
AI-generated description