« 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
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/things')
-rw-r--r--src/data/things/composite.js2
-rw-r--r--src/data/things/thing.js26
2 files changed, 11 insertions, 17 deletions
diff --git a/src/data/things/composite.js b/src/data/things/composite.js
index 4f1abdb4..e930e228 100644
--- a/src/data/things/composite.js
+++ b/src/data/things/composite.js
@@ -1207,7 +1207,7 @@ export function withResolvedReferenceList({
 
     raiseWithoutDependency(refList, {
       map: {to},
-      raise: [],
+      raise: {to: []},
       mode: 'empty',
     }),
 
diff --git a/src/data/things/thing.js b/src/data/things/thing.js
index 9bfed080..9f77c3fc 100644
--- a/src/data/things/thing.js
+++ b/src/data/things/thing.js
@@ -194,26 +194,20 @@ export default class Thing extends CacheableObject {
     // in the provided property and searches the specified wiki data for
     // matching actual Thing-subclass objects.
     dynamicThingsFromReferenceList(
-      refs,
+      refList,
       data,
       findFunction
     ) {
       return Thing.composite.from(`Thing.common.dynamicThingsFromReferenceList`, [
-        Thing.composite.earlyExitWithoutDependency(refs, {value: []}),
-        Thing.composite.earlyExitWithoutDependency(data, {value: []}),
-
-        {
-          flags: {expose: true},
-          expose: {
-            mapDependencies: {refs, data},
-            options: {findFunction},
-
-            compute: ({refs, data, '#options': {findFunction}}) =>
-              refs
-                .map(ref => findFunction(ref, data, {mode: 'quiet'}))
-                .filter(Boolean),
-          },
-        },
+        Thing.composite.withResolvedReferenceList({
+          refList,
+          data,
+          to: '#things',
+          find: findFunction,
+          notFoundMode: 'filter',
+        }),
+
+        Thing.composite.exposeDependency('#things'),
       ]);
     },