« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/control-flow/exitWithoutUpdateValue.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/composite/control-flow/exitWithoutUpdateValue.js')
-rw-r--r--src/data/composite/control-flow/exitWithoutUpdateValue.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/data/composite/control-flow/exitWithoutUpdateValue.js b/src/data/composite/control-flow/exitWithoutUpdateValue.js
index 244b3233..5104a8c0 100644
--- a/src/data/composite/control-flow/exitWithoutUpdateValue.js
+++ b/src/data/composite/control-flow/exitWithoutUpdateValue.js
@@ -10,15 +10,27 @@ export default templateCompositeFrom({
   annotation: `exitWithoutUpdateValue`,
 
   inputs: {
-    mode: inputAvailabilityCheckMode(),
     value: input({defaultValue: null}),
+    mode: inputAvailabilityCheckMode(),
+
+    validate: input({
+      type: 'function',
+      defaultValue: null,
+    }),
   },
 
+  update: ({
+    [input.staticValue('validate')]: validate,
+  }) =>
+    (validate
+      ? {validate}
+      : {}),
+
   steps: () => [
     exitWithoutDependency({
       dependency: input.updateValue(),
-      mode: input('mode'),
       value: input('value'),
+      mode: input('mode'),
     }),
   ],
 });