« 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/exitWithoutUpdateValue.js12
-rw-r--r--src/data/composite/control-flow/index.js1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/data/composite/control-flow/exitWithoutUpdateValue.js b/src/data/composite/control-flow/exitWithoutUpdateValue.js
index 244b3233..1cce233f 100644
--- a/src/data/composite/control-flow/exitWithoutUpdateValue.js
+++ b/src/data/composite/control-flow/exitWithoutUpdateValue.js
@@ -12,8 +12,20 @@ export default templateCompositeFrom({
   inputs: {
     mode: inputAvailabilityCheckMode(),
     value: input({defaultValue: null}),
+
+    validate: input({
+      type: 'function',
+      defaultValue: null,
+    }),
   },
 
+  update: ({
+    [input.staticValue('validate')]: validate,
+  }) =>
+    (validate
+      ? {validate}
+      : {}),
+
   steps: () => [
     exitWithoutDependency({
       dependency: input.updateValue(),
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';