« get me outta code hell

data: soupy reverse - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-data/withReverseReferenceList.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-01-11 20:49:26 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-01-11 20:49:26 -0400
commit77fc589466fc0c04326231638c5ec6026e7948d4 (patch)
treedbc019e4f72851bd3fa8fd5195d87fe6f6177f7c /src/data/composite/wiki-data/withReverseReferenceList.js
parent3bb0a89e80fddb985cc1fc4775e58b0d4a7445dc (diff)
data: soupy reverse
Diffstat (limited to 'src/data/composite/wiki-data/withReverseReferenceList.js')
-rw-r--r--src/data/composite/wiki-data/withReverseReferenceList.js46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/data/composite/wiki-data/withReverseReferenceList.js b/src/data/composite/wiki-data/withReverseReferenceList.js
index c62408cf..906f5bc5 100644
--- a/src/data/composite/wiki-data/withReverseReferenceList.js
+++ b/src/data/composite/wiki-data/withReverseReferenceList.js
@@ -1,34 +1,36 @@
 // Check out the info on reverseReferenceList!
 // This is its composable form.
 
-import withReverseList_template from './helpers/withReverseList-template.js';
+import {input, templateCompositeFrom} from '#composite';
 
-import {input} from '#composite';
+import gobbleSoupyReverse from './gobbleSoupyReverse.js';
+import inputSoupyReverse from './inputSoupyReverse.js';
+import inputWikiData from './inputWikiData.js';
 
-import {withPropertyFromList} from '#composite/data';
+import withResolvedReverse from './helpers/withResolvedReverse.js';
 
-export default withReverseList_template({
+export default templateCompositeFrom({
   annotation: `withReverseReferenceList`,
 
-  propertyInputName: 'list',
-  outputName: '#reverseReferenceList',
-
-  customCompositionSteps: () => [
-    {
-      dependencies: [input('data')],
-      compute: (continuation, {
-        [input('data')]: data,
-      }) => continuation({
-        ['#referencingThings']:
-          data,
-      }),
-    },
-
-    withPropertyFromList({
-      list: '#referencingThings',
-      property: input('list'),
+  inputs: {
+    data: inputWikiData({allowMixedTypes: true}),
+    reverse: inputSoupyReverse(),
+  },
+
+  outputs: ['#reverseReferenceList'],
+
+  steps: () => [
+    gobbleSoupyReverse({
+      reverse: input('reverse'),
+    }),
+
+    // TODO: Check that the reverse spec returns a list.
+
+    withResolvedReverse({
+      data: input('data'),
+      reverse: '#reverse',
     }).outputs({
-      '#values': '#referencedThings',
+      '#resolvedReverse': '#reverseReferenceList',
     }),
   ],
 });