Skip to content

I don't understand why this machine is stuck in it's initial state #1565

Answered by rjdestigter
karfau asked this question in Q&A
Discussion options

You must be logged in to vote
const CHANGE = [
        {
          actions: ['log', 'storeCurrent']
        },
        {
          cond: 'isChanged',
          target: 'validating'
        },
        {target: 'unchanged'}
      ]

Because it will never run the the second action here since the first action has no condition and will be picked.

const CHANGE = [{
         actions: ['log', 'storeCurrent']
         cond: 'isChanged',
         target: 'validating'
        },
        {target: 'unchanged'}
      ]

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@karfau
Comment options

@davidkpiano
Comment options

@karfau
Comment options

Answer selected by karfau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants