Skip to content

Instantly share code, notes, and snippets.

@theTestTube
Last active July 2, 2020 11:15
Show Gist options
  • Save theTestTube/5ef1e89acbf4e017065757d11cbbc42d to your computer and use it in GitHub Desktop.
Save theTestTube/5ef1e89acbf4e017065757d11cbbc42d to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const gpioMachine = Machine({
"id": "hydrogel",
"initial": "Inactive",
"states": {
"Inactive": {
"activities": [ { "type": "beep", "id": "inactive" } ],
"on": {
"PRESENCE": {
"target": "Active",
"actions": [ "notify"]
}
},
"initial": "InactiveLocked",
"states": {
"InactiveLocked": {
"on": {
"PRESENCE": "InactiveLocked",
"INACTIVE_LOCKED_DELAY": "InactiveUnlocked"
}
},
"InactiveUnlocked": {
"activities": [ "beep" ]
}
}
},
"Active": {
"activities": [ { "type": "gpio", "id": "active-inactive" } ],
"on": {
"ABSENCE": "Inactive",
"ACTIVE_DELAY": "Inactive"
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment