Skip to content

Instantly share code, notes, and snippets.

@pavankataria
Created January 5, 2021 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavankataria/53d08fad710f9ed3d8253987ad7d079b to your computer and use it in GitHub Desktop.
Save pavankataria/53d08fad710f9ed3d8253987ad7d079b to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'fetch',
// Initial state
initial: 'idle',
// States
states: {
idle: {
on: {
INITIALISE: 'ready'
}
},
ready: {
// Initial child state
initial: 'detailsView',
// Child states
states: {
detailsView: {
on: {
'CLICK_ITEM': 'specificDetailView'
}
},
specificDetailView: {
on: {
BACK: 'detailsView'
}
}
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment