[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3592":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":43,"readmeContent":44,"aiSummary":45,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":46,"discoverSource":47},3592,"xstate","statelyai\u002Fxstate","statelyai","State machines, statecharts, and actors for complex logic","https:\u002F\u002Fstately.ai\u002Fdocs",null,"TypeScript",29700,1362,185,97,0,2,29,118,17,97.9,"MIT License",false,"main",true,[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"background-jobs","finite-state-machine","fsm","hacktoberfest","interpreter","javascript","orchestration","scxml","state","state-machine","state-management","statechart","statecharts","typescript","visualizer","workflow","2026-06-12 04:00:18","\u003Cp align=\"center\">\n  \u003Cbr \u002F>\n\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fstatelyai\u002Fpublic-assets\u002Fmain\u002Flogos\u002Fxstate-logo-white-nobg.svg\">\n    \u003Cimg alt=\"XState logotype\" src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fstatelyai\u002Fpublic-assets\u002Fmain\u002Flogos\u002Fxstate-logo-black-nobg.svg\" width=\"200\">\n  \u003C\u002Fpicture>\n  \u003Cbr \u002F>\n    \u003Cstrong>Actor-based state management & orchestration for complex app logic.\u003C\u002Fstrong> \u003Ca href=\"https:\u002F\u002Fstately.ai\u002Fdocs\">→ Documentation\u003C\u002Fa>\n  \u003Cbr \u002F>\n  \u003Cbr \u002F>\n\u003C\u002Fp>\n\nXState is a state management and orchestration solution for JavaScript and TypeScript apps. It has _zero_ dependencies, and is useful for frontend and backend application logic.\n\nIt uses event-driven programming, state machines, statecharts, and the actor model to handle complex logic in predictable, robust, and visual ways. XState provides a powerful and flexible way to manage application and workflow state by allowing developers to model logic as actors and state machines.\n\n### ✨ Create state machines visually in Stately Studio → [state.new](https:\u002F\u002Fstate.new)\n\n---\n\n📖 [Read the documentation](https:\u002F\u002Fstately.ai\u002Fdocs)\n\n➡️ [Create state machines with the Stately Editor](https:\u002F\u002Fstately.ai\u002Feditor)\n\n🖥 [Download our VS Code extension](https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=statelyai.stately-vscode)\n\n📑 Inspired by the [SCXML specification](https:\u002F\u002Fwww.w3.org\u002FTR\u002Fscxml\u002F)\n\n💬 Chat on the [Stately Discord Community](https:\u002F\u002Fdiscord.gg\u002Fxstate)\n\n✍️ Browse through the many [XState examples](https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Fexamples)\n\n## Which package should I use?\n\nPick based on what you need:\n\n- **[`@xstate\u002Fstore`](#xstate-store)**: simple event-based state management. \u003C1kb, great TypeScript inference, similar in spirit to Redux\u002FZustand. Start here if you just need a store.\n- **[`xstate`](#super-quick-start)**: state machines, statecharts, actors, effects, and orchestration for complex app logic.\n\nThey work great together, but you don't need one to use the other.\n\n## Sponsors\n\nSpecial thanks to the sponsors who support this open-source project:\n\n\u003Cimg src=\"https:\u002F\u002Fopencollective.com\u002Fxstate\u002Ftiers\u002Fbacker\u002Fbadge.svg?label=sponsors&color=brightgreen\" \u002F>\n\n## Templates\n\nGet started by forking one of these templates on CodeSandbox:\n\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\u003Cth>Template\u003C\u002Fth>\u003Cth>\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\n\u003Ctr>\n\u003Ctd>\n\n[🤖 XState Template (CodeSandbox)](https:\u002F\u002Fcodesandbox.io\u002Fp\u002Fdevbox\u002Fgithub\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Ftemplates\u002Fvanilla-ts)\n\n[![Open in StackBlitz](https:\u002F\u002Fdeveloper.stackblitz.com\u002Fimg\u002Fopen_in_stackblitz.svg)](https:\u002F\u002Fstackblitz.com\u002Fgithub\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Ftemplates\u002Fvanilla-ts?file=%2Fsrc%2FfeedbackMachine.ts)\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n- XState v5\n- TypeScript\n- _No framework_\n\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\n\u003Ctr>\n\u003Ctd>\n\n[⚛️ XState + React Template (CodeSandbox)](https:\u002F\u002Fcodesandbox.io\u002Fp\u002Fdevbox\u002Fgithub\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Ftemplates\u002Freact-ts)\n\n[![Open in StackBlitz](https:\u002F\u002Fdeveloper.stackblitz.com\u002Fimg\u002Fopen_in_stackblitz.svg)](https:\u002F\u002Fstackblitz.com\u002Fgithub\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Ftemplates\u002Freact-ts?file=%2Fsrc%2FfeedbackMachine.ts)\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n- [React](https:\u002F\u002Freact.dev\u002F)\n- XState v5\n- TypeScript\n\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\n\u003Ctr>\n\u003Ctd>\n\n[💚 XState + Vue Template (CodeSandbox)](https:\u002F\u002Fcodesandbox.io\u002Fp\u002Fdevbox\u002Fgithub\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Ftemplates\u002Fvue-ts)\n\n[![Open in StackBlitz](https:\u002F\u002Fdeveloper.stackblitz.com\u002Fimg\u002Fopen_in_stackblitz.svg)](https:\u002F\u002Fstackblitz.com\u002Fgithub\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Ftemplates\u002Fvue-ts?file=%2Fsrc%2FfeedbackMachine.ts)\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n- [Vue](https:\u002F\u002Fvuejs.org\u002F)\n- XState v5\n- TypeScript\n\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\n\u003Ctr>\n\u003Ctd>\n\n[🧡 XState + Svelte Template (CodeSandbox)](https:\u002F\u002Fcodesandbox.io\u002Fp\u002Fdevbox\u002Fgithub\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Ftemplates\u002Fsvelte-ts)\n\n[![Open in StackBlitz](https:\u002F\u002Fdeveloper.stackblitz.com\u002Fimg\u002Fopen_in_stackblitz.svg)](https:\u002F\u002Fstackblitz.com\u002Fgithub\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Ftemplates\u002Fsvelte-ts?file=%2Fsrc%2FfeedbackMachine.ts)\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n- [Svelte](https:\u002F\u002Fsvelte.dev\u002F)\n- XState v5\n- TypeScript\n\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## Super quick start\n\n```bash\nnpm install xstate\n```\n\n```ts\nimport { createMachine, createActor, assign } from 'xstate';\n\n\u002F\u002F State machine\nconst toggleMachine = createMachine({\n  id: 'toggle',\n  initial: 'inactive',\n  context: {\n    count: 0\n  },\n  states: {\n    inactive: {\n      on: {\n        TOGGLE: { target: 'active' }\n      }\n    },\n    active: {\n      entry: assign({ count: ({ context }) => context.count + 1 }),\n      on: {\n        TOGGLE: { target: 'inactive' }\n      }\n    }\n  }\n});\n\n\u002F\u002F Actor (instance of the machine logic, like a store)\nconst toggleActor = createActor(toggleMachine);\ntoggleActor.subscribe((state) => console.log(state.value, state.context));\ntoggleActor.start();\n\u002F\u002F => logs 'inactive', { count: 0 }\n\ntoggleActor.send({ type: 'TOGGLE' });\n\u002F\u002F => logs 'active', { count: 1 }\n\ntoggleActor.send({ type: 'TOGGLE' });\n\u002F\u002F => logs 'inactive', { count: 1 }\n```\n\n---\n\n\u003Ca id=\"xstate-store\">\u003C\u002Fa>\n\n## `@xstate\u002Fstore`: simple state management\n\nNot every app needs all the features of state machines and statecharts. **[`@xstate\u002Fstore`](https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Fpackages\u002Fxstate-store)** is a separate, extremely small event-based store with first-class TypeScript inference; similar to Redux or Zustand, but with less boilerplate.\n\nUse it on its own, or graduate to full XState machines when your logic gets more complex.\n\n```bash\nnpm install @xstate\u002Fstore\n```\n\n```ts\nimport { createStore } from '@xstate\u002Fstore';\n\nconst donutStore = createStore({\n  context: {\n    donuts: 0,\n    favoriteFlavor: 'chocolate'\n  },\n  on: {\n    addDonut: (context) => ({ ...context, donuts: context.donuts + 1 }),\n    changeFlavor: (context, event: { flavor: string }) => ({\n      ...context,\n      favoriteFlavor: event.flavor\n    }),\n    eatAllDonuts: (context) => ({ ...context, donuts: 0 })\n  }\n});\n\ndonutStore.subscribe((snapshot) => {\n  console.log(snapshot.context);\n});\n\ndonutStore.send({ type: 'addDonut' });\n\u002F\u002F => { donuts: 1, favoriteFlavor: 'chocolate' }\n\ndonutStore.send({ type: 'changeFlavor', flavor: 'strawberry' });\n\u002F\u002F => { donuts: 1, favoriteFlavor: 'strawberry' }\n```\n\n📖 See the [`@xstate\u002Fstore` README](https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Fpackages\u002Fxstate-store) for React\u002FSolid bindings, selectors, and more.\n\n---\n\n## [Stately Studio](https:\u002F\u002Fstately.ai)\n\n- Visually create, edit, and collaborate on state machines\n- Export to many formats, including XState v5\n- Test path & documentation autogeneration\n- Deploy to Stately Sky\n- Generate & modify machines with Stately AI\n\n\u003Ca href=\"stately.ai\u002Fregistry\u002Fnew?ref=github\" title=\"Stately Studio\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Fassets\u002F1093738\u002F74ed9cbc-b824-4ed7-a16d-f104947af8a7\" alt=\"XState Viz\" width=\"800\" \u002F>\n\u003C\u002Fa>\n\n**[state.new](https:\u002F\u002Fstately.ai\u002Fregistry\u002Fnew?ref=github)**\n\n## Why?\n\nStatecharts are a formalism for modeling stateful, reactive systems. This is useful for declaratively describing the _behavior_ of your application, from the individual components to the overall application logic.\n\nRead [📽 the slides](http:\u002F\u002Fslides.com\u002Fdavidkpiano\u002Ffinite-state-machines) ([🎥 video](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=VU1NKX6Qkxc)) or check out these resources for learning about the importance of finite state machines and statecharts in user interfaces:\n\n- [Statecharts - A Visual Formalism for Complex Systems](https:\u002F\u002Fwww.sciencedirect.com\u002Fscience\u002Farticle\u002Fpii\u002F0167642387900359\u002Fpdf) by David Harel\n- [The World of Statecharts](https:\u002F\u002Fstatecharts.github.io\u002F) by Erik Mogensen\n\n## Packages\n\n| Package                                                                                     | Description                                                                                                                  |\n| ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |\n| 🤖 `xstate`                                                                                 | Core finite state machine and statecharts library + interpreter, including graph traversal and model-based testing utilities |\n| [🏪 `@xstate\u002Fstore`](https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Fpackages\u002Fxstate-store)   | Simple event-based state management (\u003C1kb) — standalone, works with or without `xstate`                                      |\n| [⚛️ `@xstate\u002Freact`](https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Fpackages\u002Fxstate-react)   | React hooks and utilities for using XState in React applications                                                             |\n| [💚 `@xstate\u002Fvue`](https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Fpackages\u002Fxstate-vue)       | Vue composition functions and utilities for using XState in Vue applications                                                 |\n| [🎷 `@xstate\u002Fsvelte`](https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Fpackages\u002Fxstate-svelte) | Svelte utilities for using XState in Svelte applications                                                                     |\n| [🥏 `@xstate\u002Fsolid`](https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Ftree\u002Fmain\u002Fpackages\u002Fxstate-solid)   | Solid hooks and utilities for using XState in Solid applications                                                             |\n| [🔍 `@statelyai\u002Finspect`](https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Finspect)                             | Inspection utilities for XState                                                                                              |\n\n## Finite State Machines\n\n\u003Ctable>\n\u003Cthead>\u003Ctr>\u003Cth>Code\u003C\u002Fth>\u003Cth>Statechart\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\n\n```js\nimport { createMachine, createActor } from 'xstate';\n\nconst lightMachine = createMachine({\n  id: 'light',\n  initial: 'green',\n  states: {\n    green: {\n      on: {\n        TIMER: 'yellow'\n      }\n    },\n    yellow: {\n      on: {\n        TIMER: 'red'\n      }\n    },\n    red: {\n      on: {\n        TIMER: 'green'\n      }\n    }\n  }\n});\n\nconst actor = createActor(lightMachine);\n\nactor.subscribe((state) => {\n  console.log(state.value);\n});\n\nactor.start();\n\u002F\u002F logs 'green'\n\nactor.send({ type: 'TIMER' });\n\u002F\u002F logs 'yellow'\n```\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n\u003Ca href=\"https:\u002F\u002Fstately.ai\u002Fregistry\u002Feditor\u002Ffa443471-b416-4014-8e6f-12417863e4d4?mode=design&machineId=27e86036-f2f7-40f1-9d1e-66ce6e1accc0\" title=\"Finite states\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Fassets\u002F1093738\u002F36d4b6b5-e3d0-4c19-9f41-2e3425ceac88\" alt=\"Finite states\" width=\"400\" \u002F>\n  \u003Cbr \u002F>\n  Open in Stately Studio\n\u003C\u002Fa>\n\u003Cbr \u002F>\n\n\u003C\u002Ftd>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## Hierarchical (Nested) State Machines\n\n\u003Ctable>\n\u003Cthead>\u003Ctr>\u003Cth>Code\u003C\u002Fth>\u003Cth>Statechart\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\n\n```js\nimport { createMachine, createActor } from 'xstate';\n\nconst pedestrianStates = {\n  initial: 'walk',\n  states: {\n    walk: {\n      on: {\n        PED_TIMER: 'wait'\n      }\n    },\n    wait: {\n      on: {\n        PED_TIMER: 'stop'\n      }\n    },\n    stop: {}\n  }\n};\n\nconst lightMachine = createMachine({\n  id: 'light',\n  initial: 'green',\n  states: {\n    green: {\n      on: {\n        TIMER: 'yellow'\n      }\n    },\n    yellow: {\n      on: {\n        TIMER: 'red'\n      }\n    },\n    red: {\n      on: {\n        TIMER: 'green'\n      },\n      ...pedestrianStates\n    }\n  }\n});\n\nconst actor = createActor(lightMachine);\n\nactor.subscribe((state) => {\n  console.log(state.value);\n});\n\nactor.start();\n\u002F\u002F logs 'green'\n\nactor.send({ type: 'TIMER' });\n\u002F\u002F logs 'yellow'\n\nactor.send({ type: 'TIMER' });\n\u002F\u002F logs { red: 'walk' }\n\nactor.send({ type: 'PED_TIMER' });\n\u002F\u002F logs { red: 'wait' }\n```\n\n\u003C\u002Ftd>\n\u003Ctd>\n\u003Ca href=\"https:\u002F\u002Fstately.ai\u002Fregistry\u002Feditor\u002Ffa443471-b416-4014-8e6f-12417863e4d4?mode=design&machineId=30dffcdd-16c2-49e2-bfc6-a674057cb271\" title=\"Hierarchical states\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Fassets\u002F1093738\u002F32b0692b-1c29-4469-b5e3-03146e3ef249\" alt=\"Hierarchical states\" width=\"400\" \u002F>\n  \u003Cbr \u002F>\n  Open in Stately Studio\n\u003C\u002Fa>\n\u003Cbr \u002F>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## Parallel State Machines\n\n\u003Ctable>\n\u003Cthead>\u003Ctr>\u003Cth>Code\u003C\u002Fth>\u003Cth>Statechart\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\n\n```ts\nimport { createMachine, createActor } from 'xstate';\n\nconst wordMachine = createMachine({\n  id: 'word',\n  type: 'parallel',\n  states: {\n    bold: {\n      initial: 'off',\n      states: {\n        on: {\n          on: { TOGGLE_BOLD: 'off' }\n        },\n        off: {\n          on: { TOGGLE_BOLD: 'on' }\n        }\n      }\n    },\n    underline: {\n      initial: 'off',\n      states: {\n        on: {\n          on: { TOGGLE_UNDERLINE: 'off' }\n        },\n        off: {\n          on: { TOGGLE_UNDERLINE: 'on' }\n        }\n      }\n    },\n    italics: {\n      initial: 'off',\n      states: {\n        on: {\n          on: { TOGGLE_ITALICS: 'off' }\n        },\n        off: {\n          on: { TOGGLE_ITALICS: 'on' }\n        }\n      }\n    },\n    list: {\n      initial: 'none',\n      states: {\n        none: {\n          on: {\n            BULLETS: 'bullets',\n            NUMBERS: 'numbers'\n          }\n        },\n        bullets: {\n          on: {\n            NONE: 'none',\n            NUMBERS: 'numbers'\n          }\n        },\n        numbers: {\n          on: {\n            BULLETS: 'bullets',\n            NONE: 'none'\n          }\n        }\n      }\n    }\n  }\n});\n\nconst actor = createActor(wordMachine);\n\nactor.subscribe((state) => {\n  console.log(state.value);\n});\n\nactor.start();\n\u002F\u002F logs {\n\u002F\u002F   bold: 'off',\n\u002F\u002F   italics: 'off',\n\u002F\u002F   underline: 'off',\n\u002F\u002F   list: 'none'\n\u002F\u002F }\n\nactor.send({ type: 'TOGGLE_BOLD' });\n\u002F\u002F logs {\n\u002F\u002F   bold: 'on',\n\u002F\u002F   italics: 'off',\n\u002F\u002F   underline: 'off',\n\u002F\u002F   list: 'none'\n\u002F\u002F }\n\nactor.send({ type: 'TOGGLE_ITALICS' });\n\u002F\u002F logs {\n\u002F\u002F   bold: 'on',\n\u002F\u002F   italics: 'on',\n\u002F\u002F   underline: 'off',\n\u002F\u002F   list: 'none'\n\u002F\u002F }\n```\n\n\u003C\u002Ftd>\n\u003Ctd>\n\u003Ca href=\"https:\u002F\u002Fstately.ai\u002Fregistry\u002Feditor\u002Ffa443471-b416-4014-8e6f-12417863e4d4?mode=design&machineId=980f50d8-e1ff-4441-8c8b-afe41c1610f2\" title=\"Parallel states\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Fassets\u002F1093738\u002F3b1989c0-f4a9-4653-baf2-4df3a40e91a6\" alt=\"Parallel states\" width=\"400\" \u002F>\n  \u003Cbr \u002F>\n  Open in Stately Studio\n\u003C\u002Fa>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## History States\n\n\u003Ctable>\n\u003Cthead>\u003Ctr>\u003Cth>Code\u003C\u002Fth>\u003Cth>Statechart\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>\n\n```js\nimport { createMachine, createActor } from 'xstate';\n\nconst paymentMachine = createMachine({\n  id: 'payment',\n  initial: 'method',\n  states: {\n    method: {\n      initial: 'cash',\n      states: {\n        cash: {\n          on: {\n            SWITCH_CHECK: 'check'\n          }\n        },\n        check: {\n          on: {\n            SWITCH_CASH: 'cash'\n          }\n        },\n        hist: { type: 'history' }\n      },\n      on: { NEXT: 'review' }\n    },\n    review: {\n      on: { PREVIOUS: 'method.hist' }\n    }\n  }\n});\n\nconst actor = createActor(paymentMachine);\n\nactor.subscribe((state) => {\n  console.log(state.value);\n});\n\nactor.start();\n\u002F\u002F logs {\n\u002F\u002F   value: { method: 'cash' },\n\u002F\u002F }\n\nactor.send({ type: 'SWITCH_CHECK' });\n\u002F\u002F logs {\n\u002F\u002F   value: { method: 'check' },\n\u002F\u002F }\n\nactor.send({ type: 'NEXT' });\n\u002F\u002F logs {\n\u002F\u002F   value: 'review',\n\u002F\u002F }\n\nactor.send({ type: 'PREVIOUS' });\n\u002F\u002F logs {\n\u002F\u002F   value: { method: 'check' },\n\u002F\u002F }\n```\n\n\u003C\u002Ftd>\n\u003Ctd>\n\u003Ca href=\"https:\u002F\u002Fstately.ai\u002Fregistry\u002Feditor\u002Ffa443471-b416-4014-8e6f-12417863e4d4?mode=design&machineId=d1a9bb95-db97-4af3-b38b-71b005c643d3\" title=\"History states\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fstatelyai\u002Fxstate\u002Fassets\u002F1093738\u002F1be5c495-d560-4660-94f2-5341efbf7128\" alt=\"History state\" width=\"400\" \u002F>\n  \u003Cbr \u002F>\n  Open in Stately Studio\n\u003C\u002Fa>\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## SemVer Policy\n\nWe understand the importance of the public contract and do not intend to release any breaking changes to the **runtime** API in a minor or patch release. We consider this with any changes we make to the XState libraries and aim to minimize their effects on existing users.\n\n### Breaking changes\n\nXState executes much of the user logic itself. Therefore, almost any change to its behavior might be considered a breaking change. We recognize this as a potential problem but believe that treating every change as a breaking change is not practical. We do our best to implement new features thoughtfully to enable our users to implement their logic in a better, safer way.\n\nAny change _could_ affect how existing XState machines behave if those machines are using particular configurations. We do not introduce behavior changes on a whim and aim to avoid making changes that affect most existing machines. But we reserve the right to make _some_ behavior changes in minor releases. Our best judgment of the situation will always dictate such changes. Please always read our release notes before deciding to upgrade.\n\n### TypeScript changes\n\nWe also reserve a similar right to adjust declared TypeScript definitions or drop support for older versions of TypeScript in a minor release. The TypeScript language itself evolves quickly and often introduces breaking changes in its minor releases. Our team is also continuously learning how to leverage TypeScript more effectively - and the types improve as a result.\n\nFor these reasons, it is impractical for our team to be bound by decisions taken when an older version of TypeScript was its latest version or when we didn’t know how to declare our types in a better way. We won’t introduce declaration changes often - but we are more likely to do so than with runtime changes.\n\n### Packages\n\nMost of the packages in the XState family declare a peer dependency on XState itself. We’ll be cautious about maintaining compatibility with already-released packages when releasing a new version of XState, **but** each release of packages depending on XState will always adjust the declared peer dependency range to include the latest version of XState. For example, you should always be able to update `xstate` without `@xstate\u002Freact`. But when you update `@xstate\u002Freact`, we highly recommend updating `xstate` too.\n","XState 是一个用于 JavaScript 和 TypeScript 应用的状态管理和编排解决方案。它采用事件驱动编程、状态机和 Actor 模型来处理复杂逻辑，提供了一种可预测、健壮且直观的方式来管理应用和工作流状态。项目具有零依赖特性，适用于前后端应用逻辑的开发。XState 支持通过 Stately Studio 可视化创建状态机，并提供了 VS Code 扩展以增强开发体验。其强大的功能与灵活性特别适合需要对复杂业务流程进行建模的应用场景，如工作流自动化、用户界面交互等。","2026-06-11 02:54:47","top_language"]