Skip to content

Instantly share code, notes, and snippets.

@thiagoadsix
Created September 29, 2020 20:25
Show Gist options
  • Save thiagoadsix/fb5b94fb5292527d2205a494398cc552 to your computer and use it in GitHub Desktop.
Save thiagoadsix/fb5b94fb5292527d2205a494398cc552 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'fetch',
initial: 'choosing',
states: {
choosing: {
type: 'parallel',
states: {
squire: {
initial: 'querying',
states: {
querying: {
on: {
TO_SELECTING: 'selecting'
}
},
selecting: {
initial: 'waitingAnswer',
states: {
waitingAnswer: {
},
queryingAgain: {
on: {
'': 'validating'
}
},
validating: {
on: {
SQUIRE_NOT_AVAILABLE: 'not_available',
SQUIRE_AVAILABLE: 'waitingAnswer'
}
},
not_available: {
on: {
'': 'waitingAnswer'
}
}
},
on: {
ACTION_ID: '.queryingAgain'
}
}
}
}
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment