« get me outta code hell

data: support stepless updating compositions - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-11-04 20:40:25 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-11-04 20:40:25 -0300
commite4974b2af9419acd644497274bd49f39880b2282 (patch)
tree1010438283f9c0b41c2d7a9688d0e6cccae32062
parent9e42c9f3773d431bc62fcf76f0da2cc852dfc329 (diff)
data: support stepless updating compositions
-rw-r--r--src/data/things/composite.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/data/things/composite.js b/src/data/things/composite.js
index 51525bc1..c3b08f86 100644
--- a/src/data/things/composite.js
+++ b/src/data/things/composite.js
@@ -802,8 +802,8 @@ export function compositeFrom(description) {
     });
   }
 
-  if (!compositionNests && !anyStepsCompute && !anyStepsTransform) {
-    aggregate.push(new TypeError(`Expected at least one step to compute or transform`));
+  if (!compositionNests && !compositionUpdates && !anyStepsCompute) {
+    aggregate.push(new TypeError(`Expected at least one step to compute`));
   }
 
   aggregate.close();
@@ -1241,8 +1241,10 @@ export function compositeFrom(description) {
         expose.cache = base.cacheComposition;
       }
     } else if (compositionUpdates) {
-      expose.transform = (value, dependencies) =>
-        _wrapper(value, null, dependencies);
+      if (!empty(steps)) {
+        expose.transform = (value, dependencies) =>
+          _wrapper(value, null, dependencies);
+      }
     } else {
       expose.compute = (dependencies) =>
         _wrapper(noTransformSymbol, null, dependencies);