Skip to content

Infinite paths in @xstate/graph #1395

Answered by davidkpiano
pipex asked this question in General
Discussion options

You must be logged in to vote

Yes, it is intended behavior. Finite states are finite; extended state (in context) can be infinite.

The overall state is a combination of finite state (ready or pinging or stopped) and extended state (count: 0 ... ∞)

You have to limit the state:

getShortestPaths(machine, {
  filter: (state) => state.context.pings < 10
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pipex
Comment options

Answer selected by pipex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants