Skip to content

Instantly share code, notes, and snippets.

@akshaypilankar
Last active June 20, 2021 15:08
Show Gist options
  • Save akshaypilankar/ed095d53038851250f997d98d398a335 to your computer and use it in GitHub Desktop.
Save akshaypilankar/ed095d53038851250f997d98d398a335 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
id: 'app',
initial: 'init',
context: {
user:{},
},
states: {
init:{
on: {
AUTH:'auth',
PROFILE:'profile'
}
},
auth:{
initial: 'login',
states:{
login: {
on: {
PROFILE: '#app.profile',
SIGNUP:'signup',
FORGET_PASSWORD:'forgetPassword'
}
},
signup:{
on: {
PROFILE: '#app.profile',
LOGIN:'login'
}
},
forgetPassword:{
on: {
LOGIN:'login'
}
}
}
},
profile: {
on: { LOGOUT: 'logout' },
},
logout:{
on: { AUTH: 'auth' },
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment