Last active
April 4, 2020 19:08
-
-
Save kareemkibue/972f23ecb376a554bcc60cfbbf4d7e2f to your computer and use it in GitHub Desktop.
Frequency User Machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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