Skip to content

Instantly share code, notes, and snippets.

@kareemkibue
Last active April 4, 2020 19:08
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 kareemkibue/972f23ecb376a554bcc60cfbbf4d7e2f to your computer and use it in GitHub Desktop.
Save kareemkibue/972f23ecb376a554bcc60cfbbf4d7e2f to your computer and use it in GitHub Desktop.
Frequency User Machine
const userMachine = Machine({
id: 'userPath',
initial:'login',
states:{
login: {
on: {
AUTHENTICATE: 'dashboard'
}
},
dashboard:{
on: {
'ADD CHANNEL': 'enter input' ,
'ADD LIST': 'enter input',
'REORDER LISTS': 'enter input',
'ADD/REMOVE CHANNELS TO LIST': 'drag & drop' ,
'LOG OUT': 'loggedOut'
}
},
'enter input':{
on: {
'SUBMIT': 'dashboard'
}
},
'drag & drop':{
on: {
'FINISH': 'dashboard'
}
},
loggedOut:{
type: 'final'
}
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment