Skip to content

Instantly share code, notes, and snippets.

@Damimd10
Created May 28, 2020 02:20
Show Gist options
  • Save Damimd10/745ae5a49ba70db5ec22be5270f8d71f to your computer and use it in GitHub Desktop.
Save Damimd10/745ae5a49ba70db5ec22be5270f8d71f to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const firstStep = {
initial: 'BREAK_UP',
states: {
BREAK_UP: {
on: {
START: 'START_PROPELLERS'
}
},
START_PROPELLERS: {
on: {
TURN: 'START_ENGINES'
}
},
START_ENGINES: {
on: {
SPREAD_WINGS: 'LAND'
}
},
LAND: {
type: 'final'
}
}
};
const spaceMachine = Machine({
id: "crewDragon",
initial: "active",
states: {
active: {
on: {
LAUNCH: "FIRST_MODULE"
}
},
FIRST_MODULE: {
on: {
TRANSPORT: "COUPLING"
},
...firstStep,
},
COUPLING: {
type: "final"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment