Last active
September 3, 2020 18:39
-
-
Save 0xjcf/f32f2b3d2723be1280a7ace417330b34 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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 modalMachine = Machine({ | |
id: 'modal-machine', | |
initial: 'logIn', | |
states: { | |
logIn: { | |
initial: 'idle', | |
states: { | |
idle: {} | |
}, | |
on: { | |
CHANGE: '.idle', | |
SIGN_UP: 'signUpModal', | |
LOG_IN: 'verifyLogIn' | |
} | |
}, | |
verifyLogIn: { | |
on: { | |
RESOLVE: 'mainPage', | |
REJECT: 'error' | |
} | |
}, | |
signUpModal: { | |
initial: 'idle', | |
states: { | |
idle: {} | |
}, | |
on: { | |
CHANGE: '.idle', | |
MODAL_SIGN_UP: 'mainPage' | |
} | |
}, | |
logInModal: { | |
on: { | |
CLOSE: 'logIn' | |
} | |
}, | |
mainPage: { | |
on: { | |
LOG_OUT: 'logIn' | |
} | |
}, | |
error: { | |
on: { | |
CLOSE: 'logIn' | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment