« 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/things/track/withPropertyFromMainRelease.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/composite/things/track/withPropertyFromMainRelease.js')
-rw-r--r--src/data/composite/things/track/withPropertyFromMainRelease.js86
1 files changed, 0 insertions, 86 deletions
diff --git a/src/data/composite/things/track/withPropertyFromMainRelease.js b/src/data/composite/things/track/withPropertyFromMainRelease.js
deleted file mode 100644
index 393a4c63..00000000
--- a/src/data/composite/things/track/withPropertyFromMainRelease.js
+++ /dev/null
@@ -1,86 +0,0 @@
-// Provides a value inherited from the main release, if applicable, and a
-// flag indicating if this track is a secondary release or not.
-//
-// Like withMainRelease, this will early exit (with notFoundValue) if the
-// main release is specified by reference and that reference doesn't
-// resolve to anything.
-
-import {input, templateCompositeFrom} from '#composite';
-
-import {withResultOfAvailabilityCheck} from '#composite/control-flow';
-import {withPropertyFromObject} from '#composite/data';
-
-import withMainRelease from './withMainRelease.js';
-
-export default templateCompositeFrom({
-  annotation: `inheritFromMainRelease`,
-
-  inputs: {
-    property: input({type: 'string'}),
-
-    notFoundValue: input({
-      defaultValue: null,
-    }),
-  },
-
-  outputs: ({
-    [input.staticValue('property')]: property,
-  }) =>
-    ['#isSecondaryRelease'].concat(
-      (property
-        ? ['#mainRelease.' + property]
-        : ['#mainReleaseValue'])),
-
-  steps: () => [
-    withMainRelease({
-      notFoundValue: input('notFoundValue'),
-    }),
-
-    withResultOfAvailabilityCheck({
-      from: '#mainRelease',
-    }),
-
-    {
-      dependencies: [
-        '#availability',
-        input.staticValue('property'),
-      ],
-
-      compute: (continuation, {
-        ['#availability']: availability,
-        [input.staticValue('property')]: property,
-      }) =>
-        (availability
-          ? continuation()
-          : continuation.raiseOutput(
-              Object.assign(
-                {'#isSecondaryRelease': false},
-                (property
-                  ? {['#mainRelease.' + property]: null}
-                  : {'#mainReleaseValue': null})))),
-    },
-
-    withPropertyFromObject({
-      object: '#mainRelease',
-      property: input('property'),
-    }),
-
-    {
-      dependencies: [
-        '#value',
-        input.staticValue('property'),
-      ],
-
-      compute: (continuation, {
-        ['#value']: value,
-        [input.staticValue('property')]: property,
-      }) =>
-        continuation.raiseOutput(
-          Object.assign(
-            {'#isSecondaryRelease': true},
-            (property
-              ? {['#mainRelease.' + property]: value}
-              : {'#mainReleaseValue': value}))),
-    },
-  ],
-});