« 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/thing.js
diff options
context:
space:
mode:
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: () => [