Last active
June 1, 2020 11:27
-
-
Save tsawan/d720892ea5f9f3b0a56de27f3c5c9991 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 ss = Machine({ | |
id: 'hola', | |
initial: 'na', | |
states: { | |
na: { | |
on: { | |
ACT: 'action' | |
} | |
}, | |
action: {} | |
} | |
}) | |
*/ | |
const curdMachine = Machine({ | |
id: 'crud', | |
initial: 'idle', | |
states: { | |
idle: { | |
on: { | |
ADD: 'add', | |
SELECT: 'view' | |
} | |
}, | |
view: { | |
on: { | |
ADD: 'add', | |
EDIT: 'edit', | |
DELETE: 'remove' | |
} | |
}, | |
add: { | |
on: { | |
SAVE: 'idle', | |
CANCEL: 'idle' | |
} | |
}, | |
edit: { | |
on: { | |
SAVE: 'view', | |
CANCEL: 'view' | |
} | |
}, | |
remove: { | |
on: { | |
SAVE: 'idle', | |
CANCEL: 'view' | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment