« 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/composite/wiki-properties/commentatorArtists.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/composite/wiki-properties/commentatorArtists.js')
-rw-r--r--src/data/composite/wiki-properties/commentatorArtists.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/data/composite/wiki-properties/commentatorArtists.js b/src/data/composite/wiki-properties/commentatorArtists.js
index 8720e66d..65ab1466 100644
--- a/src/data/composite/wiki-properties/commentatorArtists.js
+++ b/src/data/composite/wiki-properties/commentatorArtists.js
@@ -4,8 +4,9 @@
 import {input, templateCompositeFrom} from '#composite';
 import {unique} from '#sugar';
 
-import {exitWithoutDependency} from '#composite/control-flow';
-import {withPropertyFromList} from '#composite/data';
+import {exitWithoutDependency, exposeDependency}
+  from '#composite/control-flow';
+import {withFlattenedList, withPropertyFromList} from '#composite/data';
 import {withParsedCommentaryEntries} from '#composite/wiki-data';
 
 export default templateCompositeFrom({
@@ -26,15 +27,19 @@ export default templateCompositeFrom({
 
     withPropertyFromList({
       list: '#parsedCommentaryEntries',
-      property: input.value('artist'),
+      property: input.value('artists'),
     }).outputs({
-      '#parsedCommentaryEntries.artist': '#artists',
+      '#parsedCommentaryEntries.artists': '#artistLists',
     }),
 
-    {
-      dependencies: ['#artists'],
-      compute: ({'#artists': artists}) =>
-        unique(artists.filter(artist => artist !== null)),
-    },
+    withFlattenedList({
+      list: '#artistLists',
+    }).outputs({
+      '#flattenedList': '#artists',
+    }),
+
+    exposeDependency({
+      dependency: '#artists',
+    }),
   ],
 });