« get me outta code hell

data: exitWithoutUpdateValue: validate input - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-11-25 15:33:21 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-11-25 15:33:21 -0400
commite4125608ed4f88ba3115ffc888035922c798705c (patch)
tree75af9a14d05415dd12d2954d9a63b189dd4f27db /src
parente8506a51537f7e2cf36dcf95a81984c9f68a2364 (diff)
data: exitWithoutUpdateValue: validate input
Diffstat (limited to 'src')
-rw-r--r--src/data/composite/control-flow/exitWithoutUpdateValue.js12
1 files changed, 12 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(),