« 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
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/composite/control-flow')
-rw-r--r--src/data/composite/control-flow/exitWithoutDependency.js2
-rw-r--r--src/data/composite/control-flow/exitWithoutUpdateValue.js16
-rw-r--r--src/data/composite/control-flow/index.js1
3 files changed, 16 insertions, 3 deletions
diff --git a/src/data/composite/control-flow/exitWithoutDependency.js b/src/data/composite/control-flow/exitWithoutDependency.js
index c660a7ef..598f2ec2 100644
--- a/src/data/composite/control-flow/exitWithoutDependency.js
+++ b/src/data/composite/control-flow/exitWithoutDependency.js
@@ -11,8 +11,8 @@ export default templateCompositeFrom({
 
   inputs: {
     dependency: input({acceptsNull: true}),
-    mode: inputAvailabilityCheckMode(),
     value: input({defaultValue: null}),
+    mode: inputAvailabilityCheckMode(),
   },
 
   steps: () => [
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'),
     }),
   ],
 });
diff --git a/src/data/composite/control-flow/index.js b/src/data/composite/control-flow/index.js
index 778dc66b..61bfa08e 100644
--- a/src/data/composite/control-flow/index.js
+++ b/src/data/composite/control-flow/index.js
@@ -11,6 +11,7 @@ export {default as exposeDependencyOrContinue} from './exposeDependencyOrContinu
 export {default as exposeUpdateValueOrContinue} from './exposeUpdateValueOrContinue.js';
 export {default as exposeWhetherDependencyAvailable} from './exposeWhetherDependencyAvailable.js';
 export {default as flipFilter} from './flipFilter.js';
+export {default as inputAvailabilityCheckMode} from './inputAvailabilityCheckMode.js'; // A helper, technically...
 export {default as raiseOutputWithoutDependency} from './raiseOutputWithoutDependency.js';
 export {default as raiseOutputWithoutUpdateValue} from './raiseOutputWithoutUpdateValue.js';
 export {default as withAvailabilityFilter} from './withAvailabilityFilter.js';