« get me outta code hell

withContainingTrackSection.js « track « things « composite « data « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/things/track/withContainingTrackSection.js
blob: 9bbd9bd5bcc2c3d40e5cbaf3bcd91709331cbae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Gets the track section containing this track from its album's track list.

import {input, templateCompositeFrom} from '#composite';

import {withUniqueReferencingThing} from '#composite/wiki-data';

export default templateCompositeFrom({
  annotation: `withContainingTrackSection`,

  outputs: ['#trackSection'],

  steps: () => [
    withUniqueReferencingThing({
      data: 'trackSectionData',
      list: input.value('tracks'),
    }).outputs({
      ['#uniqueReferencingThing']: '#trackSection',
    }),
  ],
});