Created
September 11, 2021 19:13
-
-
Save YouMinTW/5fb312029f962fbcafacf46f95f07a1d 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 doorMachine = Machine({ | |
// Machine identifier | |
id: "door", | |
// Initial state | |
initial: "關著", | |
// State definitions | |
states: { | |
關著: { | |
on: { | |
// 也可以用字串描述 | |
開門: "開了" | |
} | |
}, | |
開了: { | |
on: { | |
// 可用物件描述 | |
關門: { target: "關著" } | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment