Skip to content

Is there a way to model "reversible" final states? #1291

Answered by AlCalzone
AlCalzone asked this question in General
Discussion options

You must be logged in to vote

I've played around in the visualizer and this does seem to work. However, I'm not sure if this is intended behavior that I can rely on.


  // Available variables:
  // - Machine
  // - interpret
  // - assign
  // - send
  // - sendParent
  // - spawn
  // - raise
  // - actions
  // - XState (all XState exports)
  
  function doStuff() {
    return new Promise(resolve => {
      setTimeout(resolve, 10000)
    })
  }
  
  const fetchMachine = Machine({
    id: 'fetch',
    initial: 'sendData',
    context: {
      retries: 0
    },
    states: {
      finished: {
        
      },
      sendData: {
        type: 'parallel',
        onDone: 'finished',
        states: {
          waiter: {…

Replies: 4 comments 1 reply

Comment options

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

Comment options

You must be logged in to vote
0 replies
Answer selected by AlCalzone
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants