« get me outta code hell

data: raiseResolvedReferenceList - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-data/withResolvedContribs.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-11-16 13:29:52 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-11-17 13:40:00 -0400
commit65ff74446f22976613caf352d42253c8c17e172d (patch)
tree880a7887294f8b791fef87d143ac934117dd04ee /src/data/composite/wiki-data/withResolvedContribs.js
parentf2464c6031d83108d12b08df83af2b2f8e426002 (diff)
data: raiseResolvedReferenceList
This commit also implements raiseResolvedReferenceList across
the compositions which have a notFoundMode input. This causes
no semantic changes at all, except that notFoundMode is no
longer ignored(!!) in withResolvedContribs.
Diffstat (limited to 'src/data/composite/wiki-data/withResolvedContribs.js')
-rw-r--r--src/data/composite/wiki-data/withResolvedContribs.js31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/data/composite/wiki-data/withResolvedContribs.js b/src/data/composite/wiki-data/withResolvedContribs.js
index 764d7770..b4119604 100644
--- a/src/data/composite/wiki-data/withResolvedContribs.js
+++ b/src/data/composite/wiki-data/withResolvedContribs.js
@@ -5,15 +5,16 @@
 // any artist.
 
 import {input, templateCompositeFrom} from '#composite';
-import find from '#find';
 import {filterMultipleArrays, stitchArrays} from '#sugar';
 import thingConstructors from '#things';
 import {isContributionList, isDate, isStringNonEmpty} from '#validators';
 
-import {raiseOutputWithoutDependency} from '#composite/control-flow';
-import {withPropertiesFromList} from '#composite/data';
+import {raiseOutputWithoutDependency, withAvailabilityFilter}
+  from '#composite/control-flow';
+import {withPropertyFromList, withPropertiesFromList} from '#composite/data';
 
 import inputNotFoundMode from './inputNotFoundMode.js';
+import raiseResolvedReferenceList from './raiseResolvedReferenceList.js';
 
 export default templateCompositeFrom({
   annotation: `withResolvedContribs`,
@@ -133,16 +134,20 @@ export default templateCompositeFrom({
       }),
     },
 
-    {
-      dependencies: ['#contributions'],
+    withPropertyFromList({
+      list: '#contributions',
+      property: input.value('thing'),
+    }),
 
-      compute: (continuation, {
-        ['#contributions']: contributions,
-      }) => continuation({
-        ['#resolvedContribs']:
-          contributions
-            .filter(contrib => contrib.artist),
-      }),
-    },
+    withAvailabilityFilter({
+      from: '#contributions.thing',
+    }),
+
+    raiseResolvedReferenceList({
+      notFoundMode: input('notFoundMode'),
+      results: '#contributions',
+      filter: '#availabilityFilter',
+      outputs: input.value('#resolvedContribs'),
+    }),
   ],
 });