« 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
diff options
context:
space:
mode:
Diffstat (limited to 'src/data')
-rw-r--r--src/data/composite/things/contribution/inheritFromContributionPresets.js29
1 files changed, 7 insertions, 22 deletions
diff --git a/src/data/composite/things/contribution/inheritFromContributionPresets.js b/src/data/composite/things/contribution/inheritFromContributionPresets.js
index 72642957..82425b9c 100644
--- a/src/data/composite/things/contribution/inheritFromContributionPresets.js
+++ b/src/data/composite/things/contribution/inheritFromContributionPresets.js
@@ -34,7 +34,7 @@ export default templateCompositeFrom({
       compute: (continuation, {
         ['#values']: values,
       }) => continuation({
-        ['#presetIndex']:
+        ['#index']:
           values.findIndex(value =>
             value !== undefined &&
             value !== null),
@@ -42,35 +42,20 @@ export default templateCompositeFrom({
     },
 
     raiseOutputWithoutDependency({
-      dependency: '#presetIndex',
+      dependency: '#index',
       mode: input.value('index'),
     }),
 
     {
-      dependencies: ['#presets', '#presetIndex'],
+      dependencies: ['#values', '#index'],
 
       compute: (continuation, {
-        ['#presets']: presets,
-        ['#presetIndex']: presetIndex,
+        ['#values']: values,
+        ['#index']: index,
       }) => continuation({
-        ['#preset']:
-          presets[presetIndex],
+        ['#value']:
+          values[index],
       }),
     },
-
-    withPropertyFromObject({
-      object: '#preset',
-      property: input('property'),
-    }),
-
-    // Can't use exposeDependency here since it doesn't compose, and so looks
-    // unfit to serve as the composition's base - even though we'll have raised
-    // out of this composition in the relevant cases already!
-    {
-      dependencies: ['#value'],
-      compute: (continuation, {
-        ['#value']: value,
-      }) => continuation.exit(value),
-    },
   ],
 });