« get me outta code hell

data: roll paired "byRef" and "dynamic" properties into one - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/composite.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-07 17:30:54 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-07 17:30:54 -0300
commitbbccaf51222cb4bed73466164496f5bc1030292c (patch)
treefc26c89f44b84140ba01b9edabedef10c73a637a /src/data/things/composite.js
parentc18844784bd1c0ead7c49d0519727b7a92e23e13 (diff)
data: roll paired "byRef" and "dynamic" properties into one
Diffstat (limited to 'src/data/things/composite.js')
-rw-r--r--src/data/things/composite.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/data/things/composite.js b/src/data/things/composite.js
index 29f5770c..96abf4af 100644
--- a/src/data/things/composite.js
+++ b/src/data/things/composite.js
@@ -1071,3 +1071,18 @@ export function raiseWithoutUpdateValue({
     },
   ]);
 }
+
+export function withUpdateValueAsDependency({
+  into = '#updateValue',
+} = {}) {
+  return {
+    annotation: `withUpdateValueAsDependency`,
+    flags: {expose: true, compose: true},
+
+    expose: {
+      mapContinuation: {into},
+      transform: (value, continuation) =>
+        continuation(value, {into: value}),
+    },
+  };
+}