XState v6 alpha
Input and restored snapshots
Start Vue actors with input or persisted state.
XState v6 is in alpha
APIs and behavior may change before the stable release.
Pass actor options as the second composable argument.
const { snapshot, send } = useActor(machine, {
input: { userId },
snapshot: persistedSnapshot
});Input creates new initial state. A persisted snapshot restores earlier state.
Use input to start a profile actor for one userId. Use a restored snapshot to resume a checkout after a refresh.