refactor: conditional
This commit is contained in:
parent
17f8e8ff79
commit
aa7df8f319
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue
Block a user