refactor: conditional

This commit is contained in:
cha0s 2021-02-10 07:31:07 -06:00
parent 17f8e8ff79
commit aa7df8f319

View File

@ -8,10 +8,23 @@ const serial = (expressions, context) => (new Actions(expressions)).serial(conte
export default {
conditional: (condition, expressions, context) => (
condition(context) ? serial(expressions, context) : undefined
condition ? serial(expressions, context) : undefined
),
children: () => ({
conditional: {
type: 'void',
args: [
{
type: 'condition',
label: 'Condition',
},
{
type: 'expressions',
label: 'Expressions',
},
],
},
nop: {
type: 'void',
label: 'Idle',