xstate-inspect-umd
v0.6.3-umd.0
Published
XState inspection utilities
Downloads
3
Maintainers
Readme
@xstate/inspect
This package contains inspection tools for XState.
Templates
Check out the XState + Vue Minute Timer + Viz example on CodeSandbox
Installation
- Install with npm or yarn:
npm install @xstate/inspect
# or yarn add @xstate/inspect
Via CDN
<script src="https://unpkg.com/@xstate/inspect/dist/xstate-inspect.umd.min.js"></script>
By using the global variable XStateInspect
- Import it at the beginning of your project, before any other code is called:
import { inspect } from '@xstate/inspect';
inspect({
// options
// url: 'https://statecharts.io/inspect', // (default)
iframe: false // open in new window
});
- Add
{ devTools: true }
to any interpreted machines you want to visualize:
import { interpret } from 'xstate';
import { inspect } from '@xstate/inspect';
// ...
const service = interpret(someMachine, { devTools: true });
service.start();