« 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/things/composite.js
diff options
context:
space:
mode:
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}),
+    },
+  };
+}