XState 是一个多功能的状态管理和编排库,可以与任何框架一起使用,包括与 @xstate/react
包一起使用的 React。对于许多应用程序来说,管理全局状态是一个要求,有很多选项可以在 React 中共享全局状态,比如使用 React Context 或者像 Redux、MobX 和 Zustand 这样的库。
@xstate/react
包使得使用 useMachine()
和 useActor()
这样的钩子来管理组件级状态变得简单,但它同样适用于管理全局状态 🌎
XState 是一个多功能的状态管理和编排库,可以与任何框架一起使用,包括与 @xstate/react
包一起使用的 React。对于许多应用程序来说,管理全局状态是一个要求,有很多选项可以在 React 中共享全局状态,比如使用 React Context 或者像 Redux、MobX 和 Zustand 这样的库。
@xstate/react
包使得使用 useMachine()
和 useActor()
这样的钩子来管理组件级状态变得简单,但它同样适用于管理全局状态 🌎
It’s been about a year since we’ve released Stately Studio 1.0, and a lot has happened. Stately Studio is essentially a visual software modeling tool that strives to make it easy to create, manage, and use state machines, no matter how complex they may get. Primarily, it served as a powerful set of devtools for XState (an open-source library for creating state machines, statecharts and actors in JavaScript and TypeScript). You could import XState code to a state diagram, modify it visually in an intuitive drag-and-drop canvas, and export to XState. Eventually, we added more export options: JSON, Markdown, Mermaid diagrams, and stories.
But Stately Studio has bigger ambitions than just being a suite of devtools for XState. We’ve frequently heard that these state diagrams are an important source of truth for critical app logic, serving as documentation for the entire team that stays up-to-date with your code. But a reliable source of truth for app logic is a need for all apps, not just those that use state machines directly.
That’s why we’re so excited to release Stately Studio 2.0, which aims to meet developers where they are, no matter which libraries, frameworks, or even languages they use. There are many benefits to modeling app logic with state diagrams and the actor model, and we want to enable developers to take advantage of those benefits to build more robust, feature-rich, and maintainable app logic faster.