« 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.js26
1 files changed, 10 insertions, 16 deletions
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'),
       ]);
     },