« get me outta code hell

data: withResolvedReferenceList: use withMappedList - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-data/withResolvedReferenceList.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-01-10 22:21:47 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-01-10 22:21:47 -0400
commit15fd5a5bf9331a6b407d697cfae5c0ed6971a4ab (patch)
tree9a23304d13c6f7159e43bf2de615de6b984693ea /src/data/composite/wiki-data/withResolvedReferenceList.js
parent82310b36a9a5c5321f1dd7c495bff884f588931f (diff)
data: withResolvedReferenceList: use withMappedList
Diffstat (limited to 'src/data/composite/wiki-data/withResolvedReferenceList.js')
-rw-r--r--src/data/composite/wiki-data/withResolvedReferenceList.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/data/composite/wiki-data/withResolvedReferenceList.js b/src/data/composite/wiki-data/withResolvedReferenceList.js
index 790a962f..0ac27ae3 100644
--- a/src/data/composite/wiki-data/withResolvedReferenceList.js
+++ b/src/data/composite/wiki-data/withResolvedReferenceList.js
@@ -7,6 +7,8 @@
 import {input, templateCompositeFrom} from '#composite';
 import {isString, validateArrayItems} from '#validators';
 
+import {withMappedList} from '#composite/data';
+
 import {
   exitWithoutDependency,
   raiseOutputWithoutDependency,
@@ -49,17 +51,23 @@ export default templateCompositeFrom({
     }),
 
     {
-      dependencies: [input('list'), input('data'), input('find')],
+      dependencies: [input('data'), input('find')],
       compute: (continuation, {
-        [input('list')]: list,
         [input('data')]: data,
         [input('find')]: findFunction,
-      }) =>
-        continuation({
-          '#matches': list.map(ref => findFunction(ref, data, {mode: 'quiet'})),
-        }),
+      }) => continuation({
+        ['#map']:
+          ref => findFunction(ref, data, {mode: 'quiet'}),
+      }),
     },
 
+    withMappedList({
+      list: input('list'),
+      map: '#map',
+    }).outputs({
+      '#mappedList': '#matches',
+    }),
+
     withAvailabilityFilter({
       from: '#matches',
     }),