diff options
Diffstat (limited to 'src/data/composite/things/album')
-rw-r--r-- | src/data/composite/things/album/index.js | 1 | ||||
-rw-r--r-- | src/data/composite/things/album/withTrackSections.js | 21 | ||||
-rw-r--r-- | src/data/composite/things/album/withTracks.js | 13 |
3 files changed, 25 insertions, 10 deletions
diff --git a/src/data/composite/things/album/index.js b/src/data/composite/things/album/index.js index 8b5098f0..0ef91b87 100644 --- a/src/data/composite/things/album/index.js +++ b/src/data/composite/things/album/index.js @@ -1 +1,2 @@ +export {default as withTrackSections} from './withTrackSections.js'; export {default as withTracks} from './withTracks.js'; diff --git a/src/data/composite/things/album/withTrackSections.js b/src/data/composite/things/album/withTrackSections.js new file mode 100644 index 00000000..a56bda31 --- /dev/null +++ b/src/data/composite/things/album/withTrackSections.js @@ -0,0 +1,21 @@ +import {input, templateCompositeFrom} from '#composite'; + +import find from '#find'; + +import {withResolvedReferenceList} from '#composite/wiki-data'; + +export default templateCompositeFrom({ + annotation: `withTrackSections`, + + outputs: ['#trackSections'], + + steps: () => [ + withResolvedReferenceList({ + list: 'trackSections', + data: 'ownTrackSectionData', + find: input.value(find.unqualifiedTrackSection), + }).outputs({ + ['#resolvedReferenceList']: '#trackSections', + }), + ], +}); diff --git a/src/data/composite/things/album/withTracks.js b/src/data/composite/things/album/withTracks.js index 3fe6dd2e..c8d27c4c 100644 --- a/src/data/composite/things/album/withTracks.js +++ b/src/data/composite/things/album/withTracks.js @@ -1,24 +1,17 @@ import {input, templateCompositeFrom} from '#composite'; -import find from '#find'; - -import {exitWithoutDependency} from '#composite/control-flow'; import {withFlattenedList, withPropertyFromList} from '#composite/data'; import {withResolvedReferenceList} from '#composite/wiki-data'; +import withTrackSections from './withTrackSections.js'; + export default templateCompositeFrom({ annotation: `withTracks`, outputs: ['#tracks'], steps: () => [ - withResolvedReferenceList({ - list: 'trackSections', - data: 'ownTrackSectionData', - find: input.value(find.unqualifiedTrackSection), - }).outputs({ - ['#resolvedReferenceList']: '#trackSections', - }), + withTrackSections(), withPropertyFromList({ list: '#trackSections', |