Created
August 13, 2021 05:44
-
-
Save mrtnpar/11338e28749f2e929307c4031c122e9c 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 expMachine = Machine({ | |
id: 'experiments', | |
type: 'parallel', | |
context: { | |
a: true, | |
b: false, | |
c: true, | |
d: true | |
}, | |
states: { | |
a: { | |
initial: 'initial', | |
states: { | |
initial: { | |
always: [ | |
{ target: 'enabled', cond: (context) => context.flags.a }, | |
{ target: 'disabled', cond: (context) => !context.flags.a } | |
] | |
}, | |
enabled: {}, | |
disabled: {} | |
} | |
}, | |
b: { | |
initial: 'initial', | |
states: { | |
initial: { | |
always: [ | |
{ target: 'enabled', cond: (context) => context.flags.b }, | |
{ target: 'disabled', cond: (context) => !context.flags.b } | |
] | |
}, | |
enabled: {}, | |
disabled: {} | |
} | |
}, | |
c: { | |
initial: 'initial', | |
states: { | |
initial: { | |
always: [ | |
{ target: 'enabled', cond: (context) => context.flags.c }, | |
{ target: 'disabled', cond: (context) => !context.flags.c } | |
] | |
}, | |
enabled: {}, | |
disabled: {} | |
} | |
}, | |
d: { | |
initial: 'initial', | |
states: { | |
initial: { | |
always: [ | |
{ target: 'enabled', cond: (context) => context.flags.d }, | |
{ target: 'disabled', cond: (context) => !context.flags.d } | |
] | |
}, | |
enabled: {}, | |
disabled: {} | |
} | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment