Created
June 29, 2021 09:32
-
-
Save farskid/00e392e09c2b3a7d8e8c7a3248a3fc64 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
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
Machine({ | |
initial: 'a', | |
context: {}, // enable this for the machine to work | |
states: { | |
a: { | |
entry: assign({id: 1}), | |
on: { | |
'': [ | |
{target: 'with_id', cond: ctx => !!ctx.id}, | |
'no_id' | |
] | |
} | |
}, | |
with_id: {}, | |
no_id: {} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment