« get me outta code hell

data: fix update collation from steps - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/things/thing.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-21 15:30:49 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-21 15:30:49 -0300
commitc1018a0163ae28dc122aad7cb292a5e805c3d25a (patch)
treed2cabea77e11e02f766efacc258735e395682890 /src/data/things/thing.js
parente3e8a904c24e71f303a1f29c8f1700478d929901 (diff)
data: fix update collation from steps
Diffstat (limited to 'src/data/things/thing.js')
-rw-r--r--src/data/things/thing.js35
1 files changed, 12 insertions, 23 deletions
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index 0dea1fa4..ca1018eb 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -281,24 +281,19 @@ export const referenceList = templateCompositeFrom({
   compose: false,
 
   inputs: {
-    class: input(thingClassInput),
+    class: input.staticValue(thingClassInput),
+
     find: input({type: 'function'}),
 
     // todo: validate
     data: input(),
   },
 
-  update: {
-    dependencies: [
-      input.staticValue('class'),
-    ],
-
-    compute({
-      [input.staticValue('class')]: thingClass,
-    }) {
-      const {[Thing.referenceType]: referenceType} = thingClass;
-      return {validate: validateReferenceList(referenceType)};
-    },
+  update: ({
+    [input.staticValue('class')]: thingClass,
+  }) => {
+    const {[Thing.referenceType]: referenceType} = thingClass;
+    return {validate: validateReferenceList(referenceType)};
   },
 
   steps: () => [
@@ -326,17 +321,11 @@ export const singleReference = templateCompositeFrom({
     data: input(),
   },
 
-  update: {
-    dependencies: [
-      input.staticValue('class'),
-    ],
-
-    compute({
-      [input.staticValue('class')]: thingClass,
-    }) {
-      const {[Thing.referenceType]: referenceType} = thingClass;
-      return {validate: validateReference(referenceType)};
-    },
+  update: ({
+    [input.staticValue('class')]: thingClass,
+  }) => {
+    const {[Thing.referenceType]: referenceType} = thingClass;
+    return {validate: validateReference(referenceType)};
   },
 
   steps: () => [