Skip to content

Instantly share code, notes, and snippets.

@Gi972
Last active May 13, 2020 05:41
Show Gist options
  • Select an option

  • Save Gi972/2a8c1010dd841b50547096339c84ab5a to your computer and use it in GitHub Desktop.

Select an option

Save Gi972/2a8c1010dd841b50547096339c84ab5a 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: 'slink',
initial: 'connect_view',
context: {
connected:false,
admin:"",
choosen_day:"",
new_user:true
},
states: {
connect_view:{
on:{
"CONNECT_DASHBOARD_ADMIN":[
{
target:"password_View",
cond:(context)=>context.new_user,
},
{target:"dashboard_Admin_View"}
],
}
},
dashboard_Admin_View:{},
dashboard_Client_View:{},
password_View:{
on:{'Connect':{target : 'dashboard_Admin_View'}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment