Skip to content

Instantly share code, notes, and snippets.

@trinnguyen
Last active January 13, 2021 15:13
Show Gist options
  • Save trinnguyen/d867f6752df1c58bd514ad1ee66e2042 to your computer and use it in GitHub Desktop.
Save trinnguyen/d867f6752df1c58bd514ad1ee66e2042 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 inner_S0 = {
initial: 'S0_0',
states: {
S0_0: {
on: {
'i?': 'S0_1'
}
},
S0_1: {
on: {
't, o!, x > 0': 'S0_2'
}
},
S0_2: {
type: 'final',
}
}
};
const inner_S2 = {
initial: 'S2_0',
states: {
S2_0: {
on: {
'c == Coin::C1, i? , t2': 'S2_1'
}
},
S2_1: {
type: 'final',
}
}
};
const draftv1 = Machine({
id: 'draftv1',
initial: 'S0',
states: {
S0: {
on: {
'o!': 'S1'
},
...inner_S0
},
S1: {
on: {
'h;': 'S2'
}
},
S2: {
type: 'final',
...inner_S2
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment