Skip to content

Instantly share code, notes, and snippets.

@hiroMTB
Created July 29, 2021 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiroMTB/782b0b387aeff1824cfcb074ce3a06d3 to your computer and use it in GitHub Desktop.
Save hiroMTB/782b0b387aeff1824cfcb074ce3a06d3 to your computer and use it in GitHub Desktop.
import { createMachine, actions } from 'xstate';
const { log } = actions;
export const OfficeMachine = createMachine(
{
id: 'Office',
initial: 'Office',
context: {
},
states: {
Office: {
on: {
Desk: "Desk",
Wall: "Wall",
Vox: "Vox",
}
},
Desk: {
entry: log("Desk"),
on: {
OK: "Office"
}
},
Walls: {
entry: log("Walls"),
on: {
OK: "Office"
}
},
Vox: {
entry: log("Vox"),
on: {
OK: "Puzzle_1a"
}
},
Puzzle_1a: {
entry: log("Puzzle_1a"),
on: {
OK: "Office"
}
}
},
},
{
actions: {
}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment