Skip to content

Commit

Permalink
Fix guide for nested state machines (#226)
Browse files Browse the repository at this point in the history
Closes #129
  • Loading branch information
ehuelsmann authored Dec 13, 2024
1 parent a64fdad commit ff6f092
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/guides/nested-states.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ Here we create a `nested` function that defines a submachine.

```js
// A helper function for more easily building nested state machines.
const nested = (to, states) => createMachine(states,
const nested = (to, states) => invoke(
createMachine(states),
transition('done', to)
);

Expand All @@ -90,4 +91,4 @@ const stoplight = createMachine({
dontWalk: final()
})
});
```
```

0 comments on commit ff6f092

Please sign in to comment.